mirror of
https://github.com/libressl/portable.git
synced 2026-01-17 21:51:17 +01:00
Land #1198, Fix inconsistencies in accept4.c
This commit is contained in:
@@ -6,10 +6,10 @@ accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
|
||||
{
|
||||
int rets = accept(s, addr, addrlen);
|
||||
if (rets == -1)
|
||||
return s;
|
||||
return rets;
|
||||
|
||||
if (flags & SOCK_CLOEXEC) {
|
||||
flags = fcntl(s, F_GETFD);
|
||||
flags = fcntl(rets, F_GETFD);
|
||||
fcntl(rets, F_SETFD, flags | FD_CLOEXEC);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user