You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 10:50:19 UTC

svn commit: r1132143 - /incubator/mesos/trunk/third_party/libprocess/process.cpp

Author: benh
Date: Sun Jun  5 08:50:19 2011
New Revision: 1132143

URL: http://svn.apache.org/viewvc?rev=1132143&view=rev
Log:
Enable socket reuse in libprocess.

Modified:
    incubator/mesos/trunk/third_party/libprocess/process.cpp

Modified: incubator/mesos/trunk/third_party/libprocess/process.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/process.cpp?rev=1132143&r1=1132142&r2=1132143&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/process.cpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/process.cpp Sun Jun  5 08:50:19 2011
@@ -1278,6 +1278,11 @@ void initialize()
   if (set_nbio(s) < 0)
     fatalerror("failed to initialize (set_nbio)");
 
+  /* Allow socket reuse */
+  int on = 1;
+  if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
+    perror("setsockopt(SO_REUSEADDR) failed");
+
   /* Set up socket. */
   struct sockaddr_in addr;
   memset(&addr, 0, sizeof(addr));