X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ferror.c;h=9bb3e558cb8bc197bced81d4b8278e21c047b8cf;hb=a0defda0c17171194c0d1f2957ba808629db61d4;hp=b6af64e976537285a4b7d39dbff5234eca482168;hpb=22c1c15d0a29a1b7ea75456abe3f7062f835c887;p=gnulib.git diff --git a/lib/error.c b/lib/error.c index b6af64e97..9bb3e558c 100644 --- a/lib/error.c +++ b/lib/error.c @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -40,7 +40,7 @@ # define mbsrtowcs __mbsrtowcs #endif -#if !_LIBC +#if USE_UNLOCKED_IO # include "unlocked-io.h" #endif @@ -90,9 +90,9 @@ extern void __error_at_line (int status, int errnum, const char *file_name, char *strerror_r (); # endif -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif +# ifndef SIZE_MAX +# define SIZE_MAX ((size_t) -1) +# endif /* The calling program should define program_name and set it to the name of the executing program. */ @@ -106,7 +106,7 @@ extern char *program_name; static void print_errno_message (int errnum) { - char const *s; + char const *s = NULL; #if defined HAVE_STRERROR_R || _LIBC char errbuf[1024]; @@ -115,15 +115,11 @@ print_errno_message (int errnum) # else if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) s = errbuf; - else - s = 0; # endif -#else - s = strerror (errnum); #endif #if !_LIBC - if (! s) + if (! s && ! (s = strerror (errnum))) s = _("Unknown system error"); #endif