diff options
author | Turbo Fredriksson <[email protected]> | 2013-06-04 03:54:44 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-08-15 10:19:38 -0700 |
commit | 0bc7a7a75429f3f5dc68e57dfad4c5fb84a48558 (patch) | |
tree | 47db76217ae5fd23e58b3b98b012fda846378ee9 /cmd/zfs/zfs_main.c | |
parent | abbfdca483897d4406889e3517e77baf07573ecb (diff) |
Don't specifically open /etc/mtab - it is done in libzfs_init()
a few lines further down and we can share the open file handle.
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #1498
Diffstat (limited to 'cmd/zfs/zfs_main.c')
-rw-r--r-- | cmd/zfs/zfs_main.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index cb5c87105..5753ccea0 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -66,6 +66,7 @@ #include "zfs_iter.h" #include "zfs_util.h" #include "zfs_comutil.h" +#include "libzfs_impl.h" libzfs_handle_t *g_zfs; @@ -6343,12 +6344,6 @@ main(int argc, char **argv) opterr = 0; - if ((mnttab_file = fopen(MNTTAB, "r")) == NULL) { - (void) fprintf(stderr, gettext("internal error: unable to " - "open %s\n"), MNTTAB); - return (1); - } - /* * Make sure the user has specified some command. */ @@ -6387,6 +6382,8 @@ main(int argc, char **argv) if ((g_zfs = libzfs_init()) == NULL) return (1); + mnttab_file = g_zfs->libzfs_mnttab; + zpool_set_history_str("zfs", argc, argv, history_str); verify(zpool_stage_history(g_zfs, history_str) == 0); @@ -6411,8 +6408,6 @@ main(int argc, char **argv) } libzfs_fini(g_zfs); - (void) fclose(mnttab_file); - /* * The 'ZFS_ABORT' environment variable causes us to dump core on exit * for the purposes of running ::findleaks. |