[mpich2-commits] r7477 - mpich2/trunk/src/pm/hydra/utils/sock

balaji at mcs.anl.gov balaji at mcs.anl.gov
Mon Nov 22 09:56:08 CST 2010


Author: balaji
Date: 2010-11-22 09:56:08 -0600 (Mon, 22 Nov 2010)
New Revision: 7477

Modified:
   mpich2/trunk/src/pm/hydra/utils/sock/sock.c
Log:
There is no need to set the incoming socket to blocking mode. We
should set all sockets to non-blocking.

Modified: mpich2/trunk/src/pm/hydra/utils/sock/sock.c
===================================================================
--- mpich2/trunk/src/pm/hydra/utils/sock/sock.c	2010-11-22 15:55:38 UTC (rev 7476)
+++ mpich2/trunk/src/pm/hydra/utils/sock/sock.c	2010-11-22 15:56:08 UTC (rev 7477)
@@ -286,28 +286,6 @@
     goto fn_exit;
 }
 
-static HYD_status set_block(int fd)
-{
-    int flags;
-    HYD_status status = HYD_SUCCESS;
-
-    HYDU_FUNC_ENTER();
-
-    if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
-        flags = 0;
-#if defined O_NONBLOCK
-    if (fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) < 0)
-        HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "fcntl failed on %d\n", fd);
-#endif /* O_NONBLOCK */
-
-  fn_exit:
-    HYDU_FUNC_EXIT();
-    return status;
-
-  fn_fail:
-    goto fn_exit;
-}
-
 static HYD_status alloc_fwd_hash(struct fwd_hash **fwd_hash, int in, int out)
 {
     HYD_status status = HYD_SUCCESS;
@@ -323,7 +301,7 @@
 
     (*fwd_hash)->next = NULL;
 
-    status = set_block(in);
+    status = set_nonblock(in);
     HYDU_ERR_POP(status, "unable to set out-socket to non-blocking\n");
 
     status = set_nonblock(out);



More information about the mpich2-commits mailing list