Garrett Cooper schrieb:
On Fri, Jan 16, 2009 at 12:58 AM, Garrett Cooper <yanef...@gmail.com> wrote:
On Fri, Jan 16, 2009 at 12:57 AM, Christoph Mallon
<christoph.mal...@gmx.de> wrote:
Garrett Cooper schrieb:
Good point. I modified the source to do that.
Thanks,
-Garrett
You should reply to all so the discussion stays on the list.
Yeah, that was a goofup on my part. Go-go Gmail web interface!
-Garrett

Hmmm... looks like the strerror issue it could be a serious bug:

#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>

int
main()
{

        struct stat sb;

        int o_errno;

        if (stat("/some/file/that/doesn't/exist", &sb) != 0) {
                o_errno = errno;
                printf("Errno: %d\n", errno);
                err(errno, "%s", strerror(o_errno));

You are still using the wrong errno.
Also err() itself prints the error string using strerror(). There might be some interference when the result of one call to strerror() (your call) is used after another call to strerror() (err() internally).

I doubt there is a bug in the library, otherwise we would see many bugreports of segfaults on AMD64.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to