[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: typo in error module
From: |
Eric Blake |
Subject: |
Re: typo in error module |
Date: |
Tue, 29 Aug 2006 16:57:34 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Eric Blake <ebb9 <at> byu.net> writes:
> > > Meanwhile, is this patch acceptable, which updates the _LIBC
> > > portions of the error module to resemble CVS glibc more closely, so
> > > that I have fewer spurious diffs to filter through?
> >
> > Yes, and thanks for doing some of this (normally-thankless) task.
Another upstream change to error.c worth merging:
2006-08-29 Eric Blake <address@hidden>
* error.c (error_at_line, print_errno_message): Match libc, after
resolution of upstream bug 3044.
Index: lib/error.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/error.c,v
retrieving revision 1.45
diff -u -r1.45 error.c
--- lib/error.c 14 Aug 2006 16:08:25 -0000 1.45
+++ lib/error.c 29 Aug 2006 16:45:07 -0000
@@ -92,23 +92,19 @@
char *strerror_r ();
# 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. */
extern char *program_name;
# if HAVE_STRERROR_R || defined strerror_r
# define __strerror_r strerror_r
-# endif
+# endif /* HAVE_STRERROR_R || defined strerror_r */
#endif /* not _LIBC */
static void
print_errno_message (int errnum)
{
- char const *s = NULL;
+ char const *s;
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
@@ -117,11 +113,15 @@
# else
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
s = errbuf;
+ else
+ s = 0;
# endif
+#else
+ s = strerror (errnum);
#endif
#if !_LIBC
- if (! s && ! (s = strerror (errnum)))
+ if (! s)
s = _("Unknown system error");
#endif
@@ -312,10 +312,10 @@
#if _LIBC
__fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
- file_name, line_number);
+ file_name, line_number);
#else
fprintf (stderr, file_name != NULL ? "%s:%d: " : " ",
- file_name, line_number);
+ file_name, line_number);
#endif
va_start (args, message);