mirror of
git://git.musl-libc.org/musl
synced 2025-01-10 16:49:50 +00:00
nscd: fall back gracefully on kernels without AF_UNIX support
This commit is contained in:
parent
95a540e176
commit
0ea78a6421
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user