backup errno
authorChristian Grothoff <christian@grothoff.org>
Sun, 4 Oct 2009 12:46:43 +0000 (12:46 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 4 Oct 2009 12:46:43 +0000 (12:46 +0000)
src/util/network.c

index a3033d3b04d221c829340c3e157d2979a61a1f6e..2e1d40c80a746fc0481c4141e43833efaa128ce8 100644 (file)
@@ -148,14 +148,17 @@ int
 GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc)\r
 {\r
   int ret;\r
+  int eno;\r
+\r
 #ifdef MINGW\r
   ret = closesocket (desc->fd);\r
-  SetErrnoFromWinsockError (WSAGetLastError ());\r
+  SetErrnoFromWinsockError (WSAGetLastError ());  \r
 #else\r
   ret = close (desc->fd);\r
 #endif\r
-\r
+  eno = errno;\r
   GNUNET_free (desc);\r
+  errno = eno;\r
   return ret == 0 ? GNUNET_OK : GNUNET_SYSERR;\r
 }\r
 \r