Skip to content

Commit

Permalink
Slight logic change to pstdout_hostnames_count to differentiate
Browse files Browse the repository at this point in the history
between out of memory error and bad input error with bad
[IPv6address] format error.
  • Loading branch information
chu11 committed Jan 13, 2017
1 parent 6e05a23 commit 34a37ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2017-01-03 Albert Chu <[email protected]>

* common/toolcommon/pstdout.c (pstdout_hostnames_count): Slight
logic change to differentiate between bad input and out of memory.

2016-12-28 Albert Chu <[email protected]>

* Globally support IPv6 address support in all tools as options,
Expand Down
8 changes: 4 additions & 4 deletions common/toolcommon/pstdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 34a37ae

Please sign in to comment.