X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ferror.c;h=6b3662d61d74ac843bbdd9fb3656269187a77061;hb=f53990f35803666791f4163e0f9d206bd8c4690e;hp=1149235a101ed20bb37781cc27a78d39875c990d;hpb=1936bcb20110a196671e93da989cc8bc22f2e4e0;p=gnulib.git diff --git a/lib/error.c b/lib/error.c index 1149235a1..6b3662d61 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-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 @@ -29,9 +29,7 @@ #include #include -#ifdef _LIBC -# include -#else +#if !_LIBC && ENABLE_NLS # include "gettext.h" #endif @@ -40,7 +38,7 @@ # define mbsrtowcs __mbsrtowcs #endif -#if !_LIBC +#if USE_UNLOCKED_IO # include "unlocked-io.h" #endif @@ -106,7 +104,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 +113,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