Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Feb 2011 15:18:09 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Mikolaj Golub <to.my.trociny@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r218044 - head/sbin/hastd
Message-ID:  <20110206141809.GF2035@garage.freebsd.pl>
In-Reply-To: <8662syrtm0.fsf@kopusha.home.net>
References:  <201101282156.p0SLulCc001547@svn.freebsd.org> <8662syrtm0.fsf@kopusha.home.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110206141809.GF2035>