[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1rc3-10-g784c271

mysql vizuser noreply at mpich.org
Sun Feb 9 13:15:37 CST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  784c271295a44783488fc773ca7e1a0b80386067 (commit)
      from  55ec3281bd929e4ae2b924944d23ee4d5f824886 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/784c271295a44783488fc773ca7e1a0b80386067

commit 784c271295a44783488fc773ca7e1a0b80386067
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date:   Thu Feb 6 22:07:00 2014 -0600

    Improve localhost detection.
    
    When compiled with strict we completely disable local host detection.
    In the case where no host is specified, we use the local host name
    that we get using gethostname.  However, when we try to detect if that
    is the local host, we do not even attempt to do a simple gethostname
    check.
    
    Thanks to Orion Poplawski <orion at cora.nwra.com> for reporting the
    problem and a detailed analysis of the issue.
    
    Signed-off-by: Wesley Bland <wbland at mcs.anl.gov>

diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c
index 56cd7c7..1a282cb 100644
--- a/src/pm/hydra/utils/sock/sock.c
+++ b/src/pm/hydra/utils/sock/sock.c
@@ -608,9 +608,23 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
 #else
 HYD_status HYDU_sock_is_local(char *host, int *is_local)
 {
+    char lhost[MAX_HOSTNAME_LEN];
+    HYD_status status = HYD_SUCCESS;
+
     *is_local = 0;
 
-    return HYD_SUCCESS;
+    if (gethostname(lhost, MAX_HOSTNAME_LEN) < 0) {
+        HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "gethostname returned an error\n");
+    }
+    else if (!strcmp(lhost, host)) {
+        *is_local = 1;
+    }
+
+  fn_exit:
+    return status;
+
+  fn_fail:
+    goto fn_exit;
 }
 #endif /* HAVE_GETIFADDRS && HAVE_INET_NTOP */
 

-----------------------------------------------------------------------

Summary of changes:
 src/pm/hydra/utils/sock/sock.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list