From owner-svn-src-all@FreeBSD.ORG Sun Feb 6 14:18:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D361065670; Sun, 6 Feb 2011 14:18:37 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id CCCAE8FC15; Sun, 6 Feb 2011 14:18:36 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 987E445E9D; Sun, 6 Feb 2011 15:18:35 +0100 (CET) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6C97445EAA; Sun, 6 Feb 2011 15:18:30 +0100 (CET) Date: Sun, 6 Feb 2011 15:18:09 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20110206141809.GF2035@garage.freebsd.pl> References: <201101282156.p0SLulCc001547@svn.freebsd.org> <8662syrtm0.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NAwUDtUPse4omjmu" Content-Disposition: inline In-Reply-To: <8662syrtm0.fsf@kopusha.home.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218044 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2011 14:18:37 -0000 --NAwUDtUPse4omjmu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 06, 2011 at 12:42:31AM +0200, Mikolaj Golub wrote: [...] > PJD> + /* > PJD> + * At this point descriptor to syslog socket is closed, so= if we want > PJD> + * to log assertion message, we have to first store it in = 'msg' local > PJD> + * buffer and then open syslog socket and log it. > PJD> + */ > PJD> + msg[0] =3D '\0'; > PJD> + > PJD> + maxfd =3D sysconf(_SC_OPEN_MAX); > PJD> + if (maxfd < 0) { > PJD> + pjdlog_errno(LOG_WARNING, "sysconf(_SC_OPEN_MAX) f= ailed"); >=20 > As it is commented above :-) syslog socket is closed so we can't call > pjdlog_errno() here. Correct. Fix committed. > PJD> + } else { > PJD> + isopen =3D true; /* silence gcc */ > PJD> + mode =3D 0; /* silence gcc */ > PJD> + snprintf(msg, sizeof(msg), > PJD> + "Unable to fstat descriptor %d: %s", f= d, > PJD> + strerror(errno)); >=20 > Shouldn't it break here? Yes, I think we should. My initial idea it seems was that it isn't fatal error, but it becomes messy, as we will eventually overwrite msg buffer, so I added break there. Thanks! --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --NAwUDtUPse4omjmu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk1OraEACgkQForvXbEpPzStHQCgnlNndiGoc7Wh0eQwNiwaGrpV 8XsAniyGyAMCRcLnaVDJUEFCj8+/TZxe =Nnlf -----END PGP SIGNATURE----- --NAwUDtUPse4omjmu--