aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zpool/zpool_main.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 11:57:29 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 13:42:01 -0700
commit9b020fd97a3dc449a94baec028b30b1fe3c2d5bc (patch)
tree63adfe1e69722f283a5115ff431abb550f691bed /cmd/zpool/zpool_main.c
parentd603ed6c278f9c25b17ba8e75e9bce6e5d715ac0 (diff)
Add linux user util support
This topic branch contains required changes to the user space utilities to allow them to integrate cleanly with Linux. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rw-r--r--cmd/zpool/zpool_main.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index b1b71acf8..3859bf737 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -4712,14 +4712,6 @@ main(int argc, char **argv)
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- if ((g_zfs = libzfs_init()) == NULL) {
- (void) fprintf(stderr, gettext("internal error: failed to "
- "initialize ZFS library\n"));
- return (1);
- }
-
- libzfs_print_on_error(g_zfs, B_TRUE);
-
opterr = 0;
/*
@@ -4735,9 +4727,15 @@ main(int argc, char **argv)
/*
* Special case '-?'
*/
- if (strcmp(cmdname, "-?") == 0)
+ if ((strcmp(cmdname, "-?") == 0) ||
+ strcmp(cmdname, "--help") == 0)
usage(B_TRUE);
+ if ((g_zfs = libzfs_init()) == NULL)
+ return (1);
+
+ libzfs_print_on_error(g_zfs, B_TRUE);
+
zpool_set_history_str("zpool", argc, argv, history_str);
verify(zpool_stage_history(g_zfs, history_str) == 0);