diff options
author | Jim Meyering <jim@meyering.net> | 1999-09-28 14:48:43 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-09-28 14:48:43 +0000 |
commit | a7047bf6475aaf0e27a94cfd3a0b71935841ec73 (patch) | |
tree | 45f4235a06f0098056039e1380bbe35b1f0d6976 /lib | |
parent | 6f3516dc9775c3082c91bd64e5b17fe4c75f4358 (diff) | |
download | coreutils-a7047bf6475aaf0e27a94cfd3a0b71935841ec73.tar.xz |
(error_at_line): Use strerror portably here, too,
just as was done in error.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/error.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/error.c b/lib/error.c index 4eff5d0f9..53b650c57 100644 --- a/lib/error.c +++ b/lib/error.c @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990,91,92,93,94,95,96,97,98 Free Software Foundation, Inc. + Copyright (C) 1990,91,92,93,94,95,96,97,98, 99 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. @@ -230,7 +230,10 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist) { #if defined HAVE_STRERROR_R || defined _LIBC char errbuf[1024]; - fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf)); + /* Don't use __strerror_r's return value because on some systems + (at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */ + __strerror_r (errnum, errbuf, sizeof errbuf); + fprintf (stderr, ": %s", errbuf); #else fprintf (stderr, ": %s", strerror (errnum)); #endif |