This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: strerror(), errno and syslog()
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Cc: Samuel Thibault <samuel dot thibault at ens-lyon dot org>, dave at mielke dot cc
- Date: Thu, 25 Aug 2005 23:46:38 +0200
- Subject: Re: strerror(), errno and syslog()
- References: <20050825213422.GQ7662@bouh.ens-lyon.fr>
- Reply-to: cygwin at cygwin dot com
On Aug 25 23:34, Samuel Thibault wrote:
> Hi,
>
> This crashes (yes it's odd code, but it shouldn't crash):
>
> #include <syslog.h>
> #include <errno.h>
>
> int main(void) {
> errno = -1;
> syslog(LOG_ERR,"foo");
> }
>
> Indeed, one of the first things that vsyslog does is
>
> char *errtext = strerror (get_errno ());
> int errlen = strlen (errtext);
>
> And it happens that the current implementation of strerror() returns
> NULL on invalid errno. This is not posix compliant: posix says that
This has been fixed a week ago.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader mailto:cygwin@cygwin.com
Red Hat, Inc.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/