From: eeb Date: Fri, 3 Oct 2003 11:40:39 +0000 (+0000) Subject: * Made lclt::disconnect ignore inappropriate NALs silently X-Git-Tag: v1_7_100~3146 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=83e9a4ea8214c250207c0d107aeedb254f9d4181;p=fs%2Flustre-release.git * Made lclt::disconnect ignore inappropriate NALs silently --- diff --git a/lnet/utils/portals.c b/lnet/utils/portals.c index 5fe1777..2d1a0b5 100644 --- a/lnet/utils/portals.c +++ b/lnet/utils/portals.c @@ -297,9 +297,13 @@ int g_nal_is_compatible (char *cmd, ...) if (g_nal == nal) return (1); - - fprintf (stderr, "Command %s not compatible with nal %s\n", - cmd, nal2name (g_nal)); + + if (cmd != NULL) { + /* Don't complain verbosely if we've not been passed a command + * name to complain about! */ + fprintf (stderr, "Command %s not compatible with nal %s\n", + cmd, nal2name (g_nal)); + } return (0); } @@ -841,8 +845,8 @@ int jt_ptl_disconnect(int argc, char **argv) return 0; } - if (!g_nal_is_compatible (argv[0], SOCKNAL, TOENAL, 0)) - return -1; + if (!g_nal_is_compatible (NULL, SOCKNAL, TOENAL, 0)) + return 0; if (argc >= 2 && ptl_parse_nid (&nid, argv[1]) != 0) { diff --git a/lustre/portals/utils/portals.c b/lustre/portals/utils/portals.c index 5fe1777..2d1a0b5 100644 --- a/lustre/portals/utils/portals.c +++ b/lustre/portals/utils/portals.c @@ -297,9 +297,13 @@ int g_nal_is_compatible (char *cmd, ...) if (g_nal == nal) return (1); - - fprintf (stderr, "Command %s not compatible with nal %s\n", - cmd, nal2name (g_nal)); + + if (cmd != NULL) { + /* Don't complain verbosely if we've not been passed a command + * name to complain about! */ + fprintf (stderr, "Command %s not compatible with nal %s\n", + cmd, nal2name (g_nal)); + } return (0); } @@ -841,8 +845,8 @@ int jt_ptl_disconnect(int argc, char **argv) return 0; } - if (!g_nal_is_compatible (argv[0], SOCKNAL, TOENAL, 0)) - return -1; + if (!g_nal_is_compatible (NULL, SOCKNAL, TOENAL, 0)) + return 0; if (argc >= 2 && ptl_parse_nid (&nid, argv[1]) != 0) {