From 209600fe26adc4a316b68f93c753dd1d5bc2f151 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 23 Sep 2015 21:00:30 -0700 Subject: [PATCH] Sync to PMIx master --- opal/mca/pmix/pmix1xx/pmix/VERSION | 4 +-- .../pmix1xx/pmix/src/client/pmix_client.c | 31 ++++++++++++------- .../pmix1xx/pmix/src/server/pmix_server.c | 2 +- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/opal/mca/pmix/pmix1xx/pmix/VERSION b/opal/mca/pmix/pmix1xx/pmix/VERSION index 71290757bf..567748b1b0 100644 --- a/opal/mca/pmix/pmix1xx/pmix/VERSION +++ b/opal/mca/pmix/pmix1xx/pmix/VERSION @@ -30,7 +30,7 @@ greek=a1 # command, or with the date (if "git describe" fails) in the form of # "date". -repo_rev=git4dec948 +repo_rev=git0a8e0d9 # If tarball_version is not empty, it is used as the version string in # the tarball filename, regardless of all other versions listed in @@ -44,7 +44,7 @@ tarball_version= # The date when this release was created -date="Sep 21, 2015" +date="Sep 23, 2015" # The shared library version of each of PMIx's public libraries. # These versions are maintained in accordance with the "Library diff --git a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c index 61f617af75..fcd08de9d0 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/client/pmix_client.c @@ -809,6 +809,7 @@ static pmix_status_t recv_connect_ack(int sd) pmix_status_t rc; struct timeval tv, save; pmix_socklen_t sz; + bool sockopt = true; pmix_output_verbose(2, pmix_globals.debug_output, "pmix: RECV CONNECT ACK FROM SERVER"); @@ -816,14 +817,20 @@ static pmix_status_t recv_connect_ack(int sd) /* get the current timeout value so we can reset to it */ sz = sizeof(save); if (0 != getsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, (void*)&save, &sz)) { - return PMIX_ERR_UNREACH; - } - - /* set a timeout on the blocking recv so we don't hang */ - tv.tv_sec = 2; - tv.tv_usec = 0; - if (0 != setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv))) { - return PMIX_ERR_UNREACH; + if (ENOPROTOOPT == errno) { + sockopt = false; + } else { + return PMIX_ERR_UNREACH; + } + } else { + /* set a timeout on the blocking recv so we don't hang */ + tv.tv_sec = 2; + tv.tv_usec = 0; + if (0 != setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv))) { + pmix_output_verbose(2, pmix_globals.debug_output, + "pmix: recv_connect_ack could not setsockopt SO_RCVTIMEO"); + return PMIX_ERR_UNREACH; + } } /* receive the status reply */ @@ -855,9 +862,11 @@ static pmix_status_t recv_connect_ack(int sd) return rc; } - /* return the socket to normal */ - if (0 != setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &save, sz)) { - return PMIX_ERR_UNREACH; + if (sockopt) { + /* return the socket to normal */ + if (0 != setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, &save, sz)) { + return PMIX_ERR_UNREACH; + } } return PMIX_SUCCESS; diff --git a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c index 02e715f661..62cf3ebc6b 100644 --- a/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c +++ b/opal/mca/pmix/pmix1xx/pmix/src/server/pmix_server.c @@ -114,7 +114,7 @@ static void scdes(pmix_shift_caddy_t *p) } PMIX_CLASS_INSTANCE(pmix_shift_caddy_t, pmix_object_t, - scon, NULL); + scon, scdes); #define PMIX_THREADSHIFT(r, c) \