]> granicus.if.org Git - libevent/commitdiff
Test against SO_REUSEADDR (along with _WIN32).
authorEd Schouten <ed@nuxi.nl>
Tue, 25 Aug 2015 13:29:37 +0000 (15:29 +0200)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 2 Sep 2015 16:01:48 +0000 (19:01 +0300)
This makes the code build on other systems that also don't have
SO_REUSEADDR without requiring special code.

[ azat: partially revert WIN32 check since SO_REUSEADDR on win32 differs from
unix semantics. ]

Closes #275

evutil.c

index f6b7f2ddf23ee0ed9cd6f01f5a4e2db900e4b56d..f9cbaa7d63356d89917e9da7a0871803a14f9a47 100644 (file)
--- a/evutil.c
+++ b/evutil.c
@@ -358,7 +358,7 @@ evutil_fast_socket_nonblocking(evutil_socket_t fd)
 int
 evutil_make_listen_socket_reuseable(evutil_socket_t sock)
 {
-#ifndef _WIN32
+#if defined(SO_REUSEADDR) && !defined(_WIN32)
        int one = 1;
        /* REUSEADDR on Unix means, "don't hang on to this address after the
         * listener is closed."  On Windows, though, it means "don't keep other