Revision: 257
Author: martin2812
Date: Thu Sep 16 05:05:10 2010
Log: raw socket is not connected, do not shutdown, close directly
http://code.google.com/p/monit/source/detail?r=257

Modified:
 /trunk/net.c

=======================================
--- /trunk/net.c        Thu Sep 16 03:56:37 2010
+++ /trunk/net.c        Thu Sep 16 05:05:10 2010
@@ -662,7 +662,7 @@
   struct icmp *icmpin = NULL;
   struct icmp *icmpout = NULL;
   uint16_t id_out;
-  int i, s, n = 0;
+  int r, i, s, n = 0;
   struct timeval t_out;
   struct timeval t_in;
   char buf[STRLEN];
@@ -772,7 +772,12 @@
   }

   error1:
-  close_socket(s);
+  do {
+    r = close(s);
+  } while(r == -1 && errno == EINTR);
+  if (r == -1)
+    LogError("%s: Socket %d close failed -- %s\n", prog, s, STRERROR);
+
   error2:
   freeaddrinfo(result);


_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to