projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
copy-file: Use 'quote' module consistently.
[gnulib.git]
/
lib
/
strerror.c
diff --git
a/lib/strerror.c
b/lib/strerror.c
index
4dc0b65
..
587bd21
100644
(file)
--- a/
lib/strerror.c
+++ b/
lib/strerror.c
@@
-1,6
+1,6
@@
/* strerror.c --- POSIX compatible system error routine
/* strerror.c --- POSIX compatible system error routine
- Copyright (C) 2007-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2007-201
2
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-45,22
+45,13
@@
strerror (int n)
if (msg)
return (char *) msg;
if (msg)
return (char *) msg;
- /* FreeBSD rejects 0; see http://austingroupbugs.net/view.php?id=382. */
- if (n)
- msg = strerror (n);
- else
- {
- int saved_errno = errno;
- errno = 0;
- msg = strerror (n);
- if (errno)
- msg = "Success";
- errno = saved_errno;
- }
+ msg = strerror (n);
/* Our strerror_r implementation might use the system's strerror
buffer, so all other clients of strerror have to see the error
/* Our strerror_r implementation might use the system's strerror
buffer, so all other clients of strerror have to see the error
- copied into a buffer that we manage. */
+ copied into a buffer that we manage. This is not thread-safe,
+ even if the system strerror is, but portable programs shouldn't
+ be using strerror if they care about thread-safety. */
if (!msg || !*msg)
{
static char const fmt[] = "Unknown error %d";
if (!msg || !*msg)
{
static char const fmt[] = "Unknown error %d";