diff options
author | bapt <bapt@FreeBSD.org> | 2015-12-23 10:20:46 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-12-23 10:20:46 +0000 |
commit | 5275d9d01cfce568605fed9eb0d0a0d6963a7b3b (patch) | |
tree | 7ba9fb8bd302b29dff95376b3b276d29afe7826c /cddl | |
parent | cde5c65b52c3c493f9ddb5b90b86d5b2a8e2d013 (diff) | |
download | FreeBSD-src-5275d9d01cfce568605fed9eb0d0a0d6963a7b3b.zip FreeBSD-src-5275d9d01cfce568605fed9eb0d0a0d6963a7b3b.tar.gz |
Report an error if zdb cannot initialize zfs
If the zfs module is not present and not loadable, report an error
to the user instead of crashing
Reviewed by: mahrens
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D4691
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zdb/zdb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 7f25880..346d817 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -3657,7 +3657,8 @@ main(int argc, char **argv) kernel_init(FREAD); g_zfs = libzfs_init(); - ASSERT(g_zfs != NULL); + if (g_zfs == NULL) + fatal("Fail to initialize zfs"); if (dump_all) verbose = MAX(verbose, 1); |