From 3b81e89285afdcc2eada845d11425a13bdbcc38c Mon Sep 17 00:00:00 2001 From: mav Date: Sun, 20 Mar 2016 23:29:58 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.freebsd.org/base/stable/10@297089 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/contrib/opensolaris/cmd/zdb/zdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 114bfafe3..0d88f9c08 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); -- 2.45.0