projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95a540e
)
nscd: fall back gracefully on kernels without AF_UNIX support
author
Joakim Sindholt
<opensource@zhasha.com>
Sat, 3 Apr 2021 10:50:18 +0000
(12:50 +0200)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 16 Apr 2021 14:17:42 +0000
(10:17 -0400)
src/passwd/nscd_query.c
patch
|
blob
|
history
diff --git
a/src/passwd/nscd_query.c
b/src/passwd/nscd_query.c
index
d38e371
..
dc3406b
100644
(file)
--- a/
src/passwd/nscd_query.c
+++ b/
src/passwd/nscd_query.c
@@
-40,7
+40,15
@@
retry:
buf[0] = NSCDVERSION;
fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
- if (fd < 0) return NULL;
+ if (fd < 0) {
+ if (errno == EAFNOSUPPORT) {
+ f = fopen("/dev/null", "re");
+ if (f)
+ errno = errno_save;
+ return f;
+ }
+ return 0;
+ }
if(!(f = fdopen(fd, "r"))) {
close(fd);