mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Actually use the cloexec argument in the !defined(SOCK_CLOEXEC) case
This commit is contained in:
parent
ebd4ab1506
commit
e25eb35f11
@ -1084,10 +1084,12 @@ tor_open_socket_with_extensions(int domain, int type, int protocol,
|
||||
return s;
|
||||
|
||||
#if defined(FD_CLOEXEC)
|
||||
if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
log_warn(LD_FS,"Couldn't set FD_CLOEXEC: %s", strerror(errno));
|
||||
tor_close_socket_simple(s);
|
||||
return TOR_INVALID_SOCKET;
|
||||
if (cloexec) {
|
||||
if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
log_warn(LD_FS,"Couldn't set FD_CLOEXEC: %s", strerror(errno));
|
||||
tor_close_socket_simple(s);
|
||||
return TOR_INVALID_SOCKET;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user