X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fzfs%2Fzfs_main.c;h=5f22e434ef293ba6e1febadc641ff4bc5e9d2178;hb=8c3ab23f4be92a4e55f07f8c1bb467b851ed3e54;hp=ebcec2d6e26d7bd3b263a251fcdcaa112c7efe3d;hpb=d603ed6c278f9c25b17ba8e75e9bce6e5d715ac0;p=zfs.git diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index ebcec2d..5f22e43 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -2340,6 +2340,7 @@ typedef struct rollback_cbdata { * 'cb_dependent' is set, then this is a dependent and we should report it * without checking the transaction group. */ +#ifdef HAVE_ZPL static int rollback_check(zfs_handle_t *zhp, void *data) { @@ -2399,10 +2400,12 @@ rollback_check(zfs_handle_t *zhp, void *data) zfs_close(zhp); return (0); } +#endif /* HAVE_ZPL */ static int zfs_do_rollback(int argc, char **argv) { +#ifdef HAVE_ZPL int ret; int c; boolean_t force = B_FALSE; @@ -2484,6 +2487,9 @@ out: return (0); else return (1); +#else + return ENOSYS; +#endif /*HAVE_ZPL*/ } /* @@ -4102,17 +4108,6 @@ main(int argc, char **argv) opterr = 0; - if ((g_zfs = libzfs_init()) == NULL) { - (void) fprintf(stderr, gettext("internal error: failed to " - "initialize ZFS library\n")); - return (1); - } - - zpool_set_history_str("zfs", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); - - libzfs_print_on_error(g_zfs, B_TRUE); - if ((mnttab_file = fopen(MNTTAB, "r")) == NULL) { (void) fprintf(stderr, gettext("internal error: unable to " "open %s\n"), MNTTAB); @@ -4158,9 +4153,18 @@ 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); + + zpool_set_history_str("zfs", argc, argv, history_str); + verify(zpool_stage_history(g_zfs, history_str) == 0); + + libzfs_print_on_error(g_zfs, B_TRUE); + /* * Run the appropriate command. */