summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2016-03-20 23:29:58 +0000
committermav <mav@FreeBSD.org>2016-03-20 23:29:58 +0000
commitbec00cfc57298dacbc8f54f94887bd82ea473e7f (patch)
tree7e58bb0f7108b3c38828cca31a5cddf83ba055b2 /cddl
parent2fc6ce7ddfa7217a6c9800e84489e151344cec6f (diff)
downloadFreeBSD-src-bec00cfc57298dacbc8f54f94887bd82ea473e7f.zip
FreeBSD-src-bec00cfc57298dacbc8f54f94887bd82ea473e7f.tar.gz
MFC r292653 (by bapt): 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 Differential Revision: https://reviews.freebsd.org/D4691
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/cmd/zdb/zdb.c3
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 114bfaf..0d88f9c 100644
--- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c
+++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
@@ -3658,7 +3658,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);
OpenPOWER on IntegriCloud