error.c (131447) | error.c (133543) |
---|---|
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-2002, 2003, 2004 Free Software Foundation, Inc. |
3 This file is part of the GNU C Library. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, --- 90 unchanged lines hidden (view full) --- 101# if HAVE_STRERROR_R || defined strerror_r 102# define __strerror_r strerror_r 103# endif 104#endif /* not _LIBC */ 105 106static void 107print_errno_message (int errnum) 108{ | 3 This file is part of the GNU C Library. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, --- 90 unchanged lines hidden (view full) --- 101# if HAVE_STRERROR_R || defined strerror_r 102# define __strerror_r strerror_r 103# endif 104#endif /* not _LIBC */ 105 106static void 107print_errno_message (int errnum) 108{ |
109 char const *s; | 109 char const *s = NULL; |
110 111#if defined HAVE_STRERROR_R || _LIBC 112 char errbuf[1024]; 113# if STRERROR_R_CHAR_P || _LIBC 114 s = __strerror_r (errnum, errbuf, sizeof errbuf); 115# else 116 if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) 117 s = errbuf; | 110 111#if defined HAVE_STRERROR_R || _LIBC 112 char errbuf[1024]; 113# if STRERROR_R_CHAR_P || _LIBC 114 s = __strerror_r (errnum, errbuf, sizeof errbuf); 115# else 116 if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) 117 s = errbuf; |
118 else 119 s = 0; | |
120# endif | 118# endif |
121#else 122 s = strerror (errnum); | |
123#endif 124 125#if !_LIBC | 119#endif 120 121#if !_LIBC |
126 if (! s) | 122 if (! s && ! (s = strerror (errnum))) |
127 s = _("Unknown system error"); 128#endif 129 130#if _LIBC 131 if (_IO_fwide (stderr, 0) > 0) 132 { 133 __fwprintf (stderr, L": %s", s); 134 return; --- 176 unchanged lines hidden --- | 123 s = _("Unknown system error"); 124#endif 125 126#if _LIBC 127 if (_IO_fwide (stderr, 0) > 0) 128 { 129 __fwprintf (stderr, L": %s", s); 130 return; --- 176 unchanged lines hidden --- |