未验证 提交 acbabef0 编写于 作者: O openharmony_ci 提交者: Gitee

!875 feat:a核升级socket、nscd_query部分

Merge pull request !875 from zhangdengyu/muslUpdate0419
......@@ -46,17 +46,17 @@ int socket(int domain, int type, int protocol)
}
#endif
int s = socketcall(socket, domain, type, protocol, 0, 0, 0);
if (s<0 && (errno==EINVAL || errno==EPROTONOSUPPORT)
&& (type&(SOCK_CLOEXEC|SOCK_NONBLOCK))) {
s = socketcall(socket, domain,
int s = __socketcall(socket, domain, type, protocol, 0, 0, 0);
if ((s==-EINVAL || s==-EPROTONOSUPPORT)
&& (type&(SOCK_CLOEXEC|SOCK_NONBLOCK))) {
s = __socketcall(socket, domain,
type & ~(SOCK_CLOEXEC|SOCK_NONBLOCK),
protocol, 0, 0, 0);
if (s < 0) return s;
if (s < 0) return __syscall_ret(s);
if (type & SOCK_CLOEXEC)
__syscall(SYS_fcntl, s, F_SETFD, FD_CLOEXEC);
if (type & SOCK_NONBLOCK)
__syscall(SYS_fcntl, s, F_SETFL, O_NONBLOCK);
}
return s;
return __syscall_ret(s);
}
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册