summaryrefslogtreecommitdiffstats
path: root/lib/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/error.c')
-rw-r--r--lib/error.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/error.c b/lib/error.c
index 1149235a..45698be8 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -1,5 +1,5 @@
1/* Error handler for noninteractive utilities 1/* Error handler for noninteractive utilities
2 Copyright (C) 1990-1998, 2000-2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc.
3 This file is part of the GNU C Library. 3 This file is part of the GNU C Library.
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
14 14
15 You should have received a copy of the GNU General Public License along 15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, 16 with this program; if not, write to the Free Software Foundation,
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 18
19/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */ 19/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
20 20
@@ -29,9 +29,7 @@
29#include <stdlib.h> 29#include <stdlib.h>
30#include <string.h> 30#include <string.h>
31 31
32#ifdef _LIBC 32#if !_LIBC && ENABLE_NLS
33# include <libintl.h>
34#else
35# include "gettext.h" 33# include "gettext.h"
36#endif 34#endif
37 35
@@ -40,7 +38,7 @@
40# define mbsrtowcs __mbsrtowcs 38# define mbsrtowcs __mbsrtowcs
41#endif 39#endif
42 40
43#if !_LIBC 41#if USE_UNLOCKED_IO
44# include "unlocked-io.h" 42# include "unlocked-io.h"
45#endif 43#endif
46 44
@@ -106,7 +104,7 @@ extern char *program_name;
106static void 104static void
107print_errno_message (int errnum) 105print_errno_message (int errnum)
108{ 106{
109 char const *s; 107 char const *s = NULL;
110 108
111#if defined HAVE_STRERROR_R || _LIBC 109#if defined HAVE_STRERROR_R || _LIBC
112 char errbuf[1024]; 110 char errbuf[1024];
@@ -115,15 +113,11 @@ print_errno_message (int errnum)
115# else 113# else
116 if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) 114 if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
117 s = errbuf; 115 s = errbuf;
118 else
119 s = 0;
120# endif 116# endif
121#else
122 s = strerror (errnum);
123#endif 117#endif
124 118
125#if !_LIBC 119#if !_LIBC
126 if (! s) 120 if (! s && ! (s = strerror (errnum)))
127 s = _("Unknown system error"); 121 s = _("Unknown system error");
128#endif 122#endif
129 123