svn commit: r218044 - head/sbin/hastd

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Feb 6 14:18:37 UTC 2011


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] = '\0';
>  PJD> +
>  PJD> +        maxfd = sysconf(_SC_OPEN_MAX);
>  PJD> +        if (maxfd < 0) {
>  PJD> +                pjdlog_errno(LOG_WARNING, "sysconf(_SC_OPEN_MAX) failed");
> 
> As it is commented above :-) syslog socket is closed so we can't call
> pjdlog_errno() here.

Correct. Fix committed.

>  PJD> +                } else {
>  PJD> +                        isopen = true;        /* silence gcc */
>  PJD> +                        mode = 0;        /* silence gcc */
>  PJD> +                        snprintf(msg, sizeof(msg),
>  PJD> +                            "Unable to fstat descriptor %d: %s", fd,
>  PJD> +                            strerror(errno));
> 
> 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!

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20110206/21a9c1af/attachment.pgp


More information about the svn-src-all mailing list