diff options
author | David Goulet <dgoulet@ev0ke.net> | 2015-06-03 13:56:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-06-25 11:30:47 -0400 |
commit | 699acd8d54bd685b135d3a8e758d05dd0802b820 (patch) | |
tree | 6be18bc59cf99c0b73095097c4849f679ad063a7 /src/common/compat.h | |
parent | 64bdf040f021ca3ccb661c4056ee857e2ed44a4e (diff) | |
download | tor-699acd8d54bd685b135d3a8e758d05dd0802b820.tar.gz tor-699acd8d54bd685b135d3a8e758d05dd0802b820.zip |
Validate the open file limit when creating a socket
Fixes #16288
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 5189b7e056..acf5ffd1ae 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -580,7 +580,7 @@ int network_init(void); #define ERRNO_IS_ACCEPT_EAGAIN(e) ERRNO_IS_EAGAIN(e) /** Return true if e is EMFILE or another error indicating that a call to * accept() has failed because we're out of fds or something. */ -#define ERRNO_IS_ACCEPT_RESOURCE_LIMIT(e) \ +#define ERRNO_IS_RESOURCE_LIMIT(e) \ ((e) == WSAEMFILE || (e) == WSAENOBUFS) /** Return true if e is EADDRINUSE or the local equivalent. */ #define ERRNO_IS_EADDRINUSE(e) ((e) == WSAEADDRINUSE) @@ -598,7 +598,7 @@ const char *tor_socket_strerror(int e); #define ERRNO_IS_CONN_EINPROGRESS(e) ((e) == EINPROGRESS || 0) #define ERRNO_IS_ACCEPT_EAGAIN(e) \ (ERRNO_IS_EAGAIN(e) || (e) == ECONNABORTED) -#define ERRNO_IS_ACCEPT_RESOURCE_LIMIT(e) \ +#define ERRNO_IS_RESOURCE_LIMIT(e) \ ((e) == EMFILE || (e) == ENFILE || (e) == ENOBUFS || (e) == ENOMEM) #define ERRNO_IS_EADDRINUSE(e) (((e) == EADDRINUSE) || 0) #define tor_socket_errno(sock) (errno) |