From 34a37aea9caab41e995ad1177ba55fe91e494baa Mon Sep 17 00:00:00 2001 From: "Albert L. Chu" Date: Tue, 3 Jan 2017 15:27:15 -0800 Subject: [PATCH] Slight logic change to pstdout_hostnames_count to differentiate between out of memory error and bad input error with bad [IPv6address] format error. --- ChangeLog | 5 +++++ common/toolcommon/pstdout.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9ad3f7c8..fe2a13428 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-01-03 Albert Chu + + * common/toolcommon/pstdout.c (pstdout_hostnames_count): Slight + logic change to differentiate between bad input and out of memory. + 2016-12-28 Albert Chu * Globally support IPv6 address support in all tools as options, diff --git a/common/toolcommon/pstdout.c b/common/toolcommon/pstdout.c index 398a046c6..ef6f204fd 100644 --- a/common/toolcommon/pstdout.c +++ b/common/toolcommon/pstdout.c @@ -460,17 +460,17 @@ pstdout_hostnames_count(const char *hostnames) return -1; } - if (!(h = fi_hostlist_create(hostnames))) + if (!(h = fi_hostlist_create(NULL))) { pstdout_errnum = PSTDOUT_ERR_OUTMEM; goto cleanup; } - if (!(count = fi_hostlist_count(h))) + if (!(count = fi_hostlist_push(h, hostnames))) { if (pstdout_debug_flags & PSTDOUT_DEBUG_STANDARD) - fprintf(stderr, "hostnames count == 0\n"); - pstdout_errnum = PSTDOUT_ERR_INTERNAL; + fprintf(stderr, "valid hostnames count == 0\n"); + pstdout_errnum = PSTDOUT_ERR_PARAMETERS; goto cleanup; }