aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zdb
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-05-20 14:39:52 -0700
committerBrian Behlendorf <[email protected]>2015-05-22 13:34:58 -0700
commit65037d9b25c2bfa98d0aa5c9e34678127c03b345 (patch)
treef952dd40e26497af55a6a61cf9c42ea6baa7d6dc /cmd/zdb
parent87abfcba2283bfeb6636caf9aa2a72186d7708c4 (diff)
Add libzfs_error_init() function
All fprintf() error messages are moved out of the libzfs_init() library function where they never belonged in the first place. A libzfs_error_init() function is added to provide useful error messages for the most common causes of failure. Additionally, in libzfs_run_process() the 'rc' variable was renamed to 'error' for consistency with the rest of the code base. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Richard Yao <[email protected]>
Diffstat (limited to 'cmd/zdb')
-rw-r--r--cmd/zdb/zdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index fc6e3fff0..6e75d0c21 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -3699,8 +3699,10 @@ main(int argc, char **argv)
zfs_vdev_async_read_max_active = 10;
kernel_init(FREAD);
- if ((g_zfs = libzfs_init()) == NULL)
+ if ((g_zfs = libzfs_init()) == NULL) {
+ (void) fprintf(stderr, "%s", libzfs_error_init(errno));
return (1);
+ }
if (dump_all)
verbose = MAX(verbose, 1);