summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Johnston <rob.johnston@joyent.com>2018-01-10 23:25:26 +0000
committerRob Johnston <rob.johnston@joyent.com>2018-01-11 22:22:35 +0000
commit1ef99971ad2616a8de302dd477959779911def3a (patch)
tree6d6ea6729287495cf3d27fae975f6da2a5c3fdcc
parent3f0dd18067ae2e49a2f58cbeab0ddc5ef8ee1ec6 (diff)
downloadillumos-joyent-1ef99971ad2616a8de302dd477959779911def3a.tar.gz
OS-6557 fmdump misinterprets retval of nvlist_print_json()
Reviewed by: Joshua M. Clulow <jmc@joyent.com> Reviewed by: Dan McDonald <danmcd@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/fm/fmdump/common/nvlrender.c2
-rw-r--r--usr/src/test/util-tests/tests/libnvpair_json/print_json.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/usr/src/cmd/fm/fmdump/common/nvlrender.c b/usr/src/cmd/fm/fmdump/common/nvlrender.c
index 2c2f5ca662..99f027a77d 100644
--- a/usr/src/cmd/fm/fmdump/common/nvlrender.c
+++ b/usr/src/cmd/fm/fmdump/common/nvlrender.c
@@ -83,7 +83,7 @@ fmdump_render_nvlist(nvlist_prtctl_t pctl, void *private, nvlist_t *nvl,
int
fmdump_print_json(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
{
- if (nvlist_print_json(fp, rp->rec_nvl) != 0 || fprintf(fp, "\n") < 0 ||
+ if (nvlist_print_json(fp, rp->rec_nvl) < 0 || fprintf(fp, "\n") < 0 ||
fflush(fp) != 0)
return (-1);
diff --git a/usr/src/test/util-tests/tests/libnvpair_json/print_json.c b/usr/src/test/util-tests/tests/libnvpair_json/print_json.c
index e34ae8f7b1..9ac19b1bd1 100644
--- a/usr/src/test/util-tests/tests/libnvpair_json/print_json.c
+++ b/usr/src/test/util-tests/tests/libnvpair_json/print_json.c
@@ -814,7 +814,7 @@ main(int argc, char **argv)
/*
* Print the resultant list, and a terminating newline:
*/
- if (nvlist_print_json(stdout, lw->lw_nvl[0]) != 0 ||
+ if (nvlist_print_json(stdout, lw->lw_nvl[0]) < 0 ||
fprintf(stdout, "\n") < 0)
goto out;