mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
Don't both open the socket with SOCK_CLOEXEC and set FD_CLOEXEC
This commit is contained in:
parent
9d63dfcf49
commit
15f2b7859b
@ -935,11 +935,12 @@ tor_open_socket(int domain, int type, int protocol)
|
||||
{
|
||||
int s;
|
||||
#ifdef SOCK_CLOEXEC
|
||||
#define LINUX_CLOEXEC_OPEN_SOCKET
|
||||
type |= SOCK_CLOEXEC;
|
||||
#endif
|
||||
s = socket(domain, type, protocol);
|
||||
if (s >= 0) {
|
||||
#ifdef FD_CLOEXEC
|
||||
#if !defined(LINUX_CLOEXEC_OPEN_SOCKET) && defined(FD_CLOEXEC)
|
||||
fcntl(s, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
socket_accounting_lock();
|
||||
|
Loading…
Reference in New Issue
Block a user