aboutsummaryrefslogtreecommitdiff
path: root/src/util/network.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-25 23:14:45 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-25 23:14:45 +0000
commitc3fee331d5dd4784c7a793f5a63853101e1ceee3 (patch)
treef859e6ac09758925222785ab09a1965b0db66e11 /src/util/network.c
parent200c39244ad165f003ec810320b415dda6ec7542 (diff)
downloadgnunet-c3fee331d5dd4784c7a793f5a63853101e1ceee3.tar.gz
gnunet-c3fee331d5dd4784c7a793f5a63853101e1ceee3.zip
-make sure we get the correct errno back after GNUNET_NETWORK_socket_create()
Diffstat (limited to 'src/util/network.c')
-rw-r--r--src/util/network.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/util/network.c b/src/util/network.c
index 968870def..79c25c4d0 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -931,14 +931,13 @@ GNUNET_NETWORK_socket_create (int domain,
931 int protocol) 931 int protocol)
932{ 932{
933 struct GNUNET_NETWORK_Handle *ret; 933 struct GNUNET_NETWORK_Handle *ret;
934 int fd;
934 935
935 ret = GNUNET_new (struct GNUNET_NETWORK_Handle); 936 fd = socket (domain, type, protocol);
936 ret->fd = socket (domain, type, protocol); 937 if (-1 == fd)
937 if (-1 == ret->fd)
938 {
939 GNUNET_free (ret);
940 return NULL; 938 return NULL;
941 } 939 ret = GNUNET_new (struct GNUNET_NETWORK_Handle);
940 ret->fd = fd;
942 if (GNUNET_OK != 941 if (GNUNET_OK !=
943 initialize_network_handle (ret, 942 initialize_network_handle (ret,
944 domain, 943 domain,