diff --git a/changes/bug4535 b/changes/bug4535 new file mode 100644 index 0000000000..57ced29d0b --- /dev/null +++ b/changes/bug4535 @@ -0,0 +1,3 @@ + o Minor bugfixes: + - Use tor_socket_t type for listener argument to accept(). Fixes bug + 4535; bugfix on 0.2.2.28-beta. Found by "troll_un". diff --git a/src/common/compat.c b/src/common/compat.c index ea95f9f085..33e2864ada 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -979,7 +979,7 @@ tor_open_socket(int domain, int type, int protocol) /** As socket(), but counts the number of open sockets. */ tor_socket_t -tor_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *len) +tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr, socklen_t *len) { tor_socket_t s; #if defined(HAVE_ACCEPT4) && defined(SOCK_CLOEXEC) diff --git a/src/common/compat.h b/src/common/compat.h index db541623d3..a228a46cf8 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -408,7 +408,7 @@ typedef int socklen_t; int tor_close_socket(tor_socket_t s); tor_socket_t tor_open_socket(int domain, int type, int protocol); -tor_socket_t tor_accept_socket(int sockfd, struct sockaddr *addr, +tor_socket_t tor_accept_socket(tor_socket_t sockfd, struct sockaddr *addr, socklen_t *len); int get_n_open_sockets(void);