check return codes everywhere
authorChristian Grothoff <christian@grothoff.org>
Tue, 20 Oct 2009 19:28:16 +0000 (19:28 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 20 Oct 2009 19:28:16 +0000 (19:28 +0000)
src/util/connection.c
src/util/network.c

index fa8430638cdf352e62e8a405406a25403f50bf70..7e4825e458d021b58d3537e756270107fd789f33 100644 (file)
@@ -708,7 +708,7 @@ connect_probe_continuation (void *cls,
        (GNUNET_OK != GNUNET_NETWORK_socket_getsockopt (ap->sock, SOL_SOCKET, SO_ERROR, &error, &len)) ||
        (error != 0) || (errno != 0) )
     {
-      GNUNET_NETWORK_socket_close (ap->sock);
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (ap->sock));
       GNUNET_free (ap);
       if ( (NULL == h->ap_head) &&
           (h->dns_active == GNUNET_NO) )
@@ -724,7 +724,7 @@ connect_probe_continuation (void *cls,
   /* cancel all other attempts */
   while (NULL != (pos = h->ap_head))
     {
-      GNUNET_NETWORK_socket_close (pos->sock);
+      GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock));
       GNUNET_SCHEDULER_cancel (h->sched, pos->task);
       GNUNET_CONTAINER_DLL_remove (h->ap_head, h->ap_tail, pos);
       GNUNET_free (pos);
index b5e65de60069ea5532610d93e6448dcded56a9a2..dfdd44fa60d80bbd4c1379ee1338b575411f830a 100644 (file)
@@ -186,7 +186,7 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc,
 #ifndef MINGW\r
   if (ret->fd >= FD_SETSIZE)\r
     {\r
-      close (ret->fd);\r
+      GNUNET_break (0 == close (ret->fd));\r
       GNUNET_free (ret);\r
       errno = EMFILE;\r
       return NULL;\r
@@ -481,7 +481,7 @@ GNUNET_NETWORK_socket_create (int domain, int type, int protocol)
 #ifndef MINGW\r
   if (ret->fd >= FD_SETSIZE)\r
     {\r
-      close (ret->fd);\r
+      GNUNET_break (0 == close (ret->fd));\r
       GNUNET_free (ret);\r
       errno = EMFILE;\r
       return NULL;\r