projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
define NULL as nullptr when used in C++11 or later
[musl]
/
src
/
passwd
/
getspnam.c
diff --git
a/src/passwd/getspnam.c
b/src/passwd/getspnam.c
index
041f896
..
709b526
100644
(file)
--- a/
src/passwd/getspnam.c
+++ b/
src/passwd/getspnam.c
@@
-8,10
+8,11
@@
struct spwd *getspnam(const char *name)
static char *line;
struct spwd *res;
int e;
+ int orig_errno = errno;
if (!line) line = malloc(LINE_LIM);
if (!line) return 0;
e = getspnam_r(name, &sp, line, LINE_LIM, &res);
-
if (e) errno = e
;
+
errno = e ? e : orig_errno
;
return res;
}