aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/compat.c')
-rw-r--r--src/common/compat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index fbb37ce031..1a03f5efc7 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -1013,10 +1013,11 @@ tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr, socklen_t *len)
s = accept4(sockfd, addr, len, SOCK_CLOEXEC);
if (SOCKET_OK(s))
goto socket_ok;
- /* If we got an error, see if it is EINVAL. EINVAL might indicate that,
+ /* If we got an error, see if it is ENOSYS. ENOSYS indicates that,
* event though we were built on a system with accept4 support, we
- * are running on one without. */
- if (errno != EINVAL)
+ * are running on one without. Also, check for EINVAL, which indicates that
+ * we are missing SOCK_CLOEXEC support. */
+ if (errno != EINVAL && errno != ENOSYS)
return s;
#endif