summaryrefslogtreecommitdiffstats
path: root/cmd/mount_zfs
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/mount_zfs
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/mount_zfs')
-rw-r--r--cmd/mount_zfs/mount_zfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c
index 6cdb668f5..0f4995943 100644
--- a/cmd/mount_zfs/mount_zfs.c
+++ b/cmd/mount_zfs/mount_zfs.c
@@ -473,8 +473,10 @@ main(int argc, char **argv)
if (zfsflags & ZS_ZFSUTIL)
zfsutil = 1;
- if ((g_zfs = libzfs_init()) == NULL)
+ if ((g_zfs = libzfs_init()) == NULL) {
+ (void) fprintf(stderr, "%s", libzfs_error_init(errno));
return (MOUNT_SYSERR);
+ }
/* try to open the dataset to access the mount point */
if ((zhp = zfs_open(g_zfs, dataset,