[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] gnulib error.c port to OpenBSD 3.4
From: |
Paul Eggert |
Subject: |
[Bug-gnulib] gnulib error.c port to OpenBSD 3.4 |
Date: |
Thu, 05 Aug 2004 16:40:37 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
I installed this:
2004-08-05 Paul Eggert <address@hidden>
* error.c: Work around bug in OpenBSD 3.4 sterror_r: it
sometimes returns a positive errno value even when it succeeds.
(print_errno_message) [!LIBC]: Fall back on strerror if
__strerror_r fails.
Index: lib/error.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/error.c,v
retrieving revision 1.38
diff -p -u -r1.38 error.c
--- lib/error.c 28 Sep 2003 08:09:13 -0000 1.38
+++ lib/error.c 5 Aug 2004 23:12:55 -0000
@@ -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
@@ -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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gnulib] gnulib error.c port to OpenBSD 3.4,
Paul Eggert <=