diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-01-30 15:54:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-01-30 15:54:13 +0000 |
commit | 59943eb54a55aa6ddd0921eb81bc325d55bcae72 (patch) | |
tree | 4477f33a5d8c53cac88dde8c440945c322e34f13 /src | |
parent | ff3529ccfc3f7df86531900b40dd37dc0617387b (diff) | |
download | gnunet-59943eb54a55aa6ddd0921eb81bc325d55bcae72.tar.gz gnunet-59943eb54a55aa6ddd0921eb81bc325d55bcae72.zip |
-check for EINPROGRESS for UNIX, hopefully fixing #2741
Diffstat (limited to 'src')
-rw-r--r-- | src/util/connection.c | 5 | ||||
-rw-r--r-- | src/util/network.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/util/connection.c b/src/util/connection.c index d7ae12fb3..c4795cebe 100644 --- a/src/util/connection.c +++ b/src/util/connection.c | |||
@@ -864,8 +864,9 @@ GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct | |||
864 | GNUNET_free (connection); | 864 | GNUNET_free (connection); |
865 | return NULL; | 865 | return NULL; |
866 | } | 866 | } |
867 | if (GNUNET_OK != | 867 | if ( (GNUNET_OK != |
868 | GNUNET_NETWORK_socket_connect (connection->sock, connection->addr, connection->addrlen)) | 868 | GNUNET_NETWORK_socket_connect (connection->sock, connection->addr, connection->addrlen)) && |
869 | (EINPROGRESS != errno) ) | ||
869 | { | 870 | { |
870 | /* Just return; we expect everything to work eventually so don't fail HARD */ | 871 | /* Just return; we expect everything to work eventually so don't fail HARD */ |
871 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (connection->sock)); | 872 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (connection->sock)); |
diff --git a/src/util/network.c b/src/util/network.c index 69db7cd25..bea6bfbb2 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -144,12 +144,13 @@ GNUNET_NETWORK_shorten_unixpath (char *unixpath) | |||
144 | 144 | ||
145 | /** | 145 | /** |
146 | * Set if a socket should use blocking or non-blocking IO. | 146 | * Set if a socket should use blocking or non-blocking IO. |
147 | * | ||
147 | * @param fd socket | 148 | * @param fd socket |
148 | * @param doBlock blocking mode | 149 | * @param doBlock blocking mode |
149 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 150 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
150 | */ | 151 | */ |
151 | static int | 152 | int |
152 | socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, int doBlock) | 153 | GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, int doBlock) |
153 | { | 154 | { |
154 | 155 | ||
155 | #if MINGW | 156 | #if MINGW |
@@ -307,7 +308,7 @@ initialize_network_handle (struct GNUNET_NETWORK_Handle *h, | |||
307 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | 308 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, |
308 | "socket_set_inheritable"); | 309 | "socket_set_inheritable"); |
309 | 310 | ||
310 | if (GNUNET_SYSERR == socket_set_blocking (h, GNUNET_NO)) | 311 | if (GNUNET_SYSERR == GNUNET_NETWORK_socket_set_blocking (h, GNUNET_NO)) |
311 | { | 312 | { |
312 | GNUNET_break (0); | 313 | GNUNET_break (0); |
313 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (h)); | 314 | GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (h)); |