From bbb75c11908d1009b6749b797b3a763558bbaaaf Mon Sep 17 00:00:00 2001 From: Aaron Fineman Date: Thu, 27 Jun 2013 15:19:25 -0400 Subject: [PATCH] Add error message for missing /etc/mtab The zpool command should not silently fail when the /etc/mtab file does not exist. This can occur in an initramfs environment when the /etc/mtab file hasn't yet been generated. Signed-off-by: Brian Behlendorf Closes #1541 --- lib/libzfs/libzfs_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index a4e1255bb..5bb88e946 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -704,6 +704,8 @@ libzfs_init(void) if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) { #endif (void) close(hdl->libzfs_fd); + (void) fprintf(stderr, + gettext("mtab is not present at %s.\n"), MNTTAB); free(hdl); return (NULL); } -- 2.40.0