diff options
author | Gregor Kopka <[email protected]> | 2012-03-14 14:34:00 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-03-15 10:24:00 -0700 |
commit | 42cb3819f1a1f536105faac81ffc150f3da90a80 (patch) | |
tree | 5458e28574eb444d18bcb4ab8388e1d9db93e6c2 /cmd/zpool/zpool_main.c | |
parent | 0ece356db51e225c3d4a26dff7cf67c99b6b9c55 (diff) |
Use stderr for 'no pools/datasets available' error
The 'zfs list' and 'zpool list' commands output the message
'no datasets/pools available' to stdout. This should go to
stderr and only the available datasets/pools should go to
stdout. Returning nothing to stdout is expected behavior
when there is nothing to list.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #581
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rwxr-xr-x[-rw-r--r--] | cmd/zpool/zpool_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index fd9d69f12..9e73ddaff 100644..100755 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -2358,7 +2358,7 @@ zpool_do_iostat(int argc, char **argv) pool_list_update(list); if ((npools = pool_list_count(list)) == 0) - (void) printf(gettext("no pools available\n")); + (void) fprintf(stderr, gettext("no pools available\n")); else { /* * Refresh all statistics. This is done as an @@ -2599,7 +2599,7 @@ zpool_do_list(int argc, char **argv) list_callback, &cb); if (argc == 0 && cb.cb_first) - (void) printf(gettext("no pools available\n")); + (void) fprintf(stderr, gettext("no pools available\n")); else if (argc && cb.cb_first) { /* cannot open the given pool */ zprop_free_list(cb.cb_proplist); @@ -3793,7 +3793,7 @@ zpool_do_status(int argc, char **argv) status_callback, &cb); if (argc == 0 && cb.cb_count == 0) - (void) printf(gettext("no pools available\n")); + (void) fprintf(stderr, gettext("no pools available\n")); else if (cb.cb_explain && cb.cb_first && cb.cb_allpools) (void) printf(gettext("all pools are healthy\n")); @@ -4219,7 +4219,7 @@ zpool_do_history(int argc, char **argv) &cbdata); if (argc == 0 && cbdata.first == B_TRUE) { - (void) printf(gettext("no pools available\n")); + (void) fprintf(stderr, gettext("no pools available\n")); return (0); } |