From dc444615c90beb3886a0201e6db1663b95388eea Mon Sep 17 00:00:00 2001 From: pjd Date: Tue, 12 Apr 2011 20:31:33 +0000 Subject: Fix 'zfs list ' handling. If the path was found, the 'ret' variable was uninitialized. PR: kern/155940 Submitted by: KOIE Hidetaka MFC after: 1 week --- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c index 01738fb..e457a23 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c @@ -734,12 +734,13 @@ zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype) { struct statfs sfs; - if (statfs(path, &sfs) != 0) { + ret = statfs(path, &sfs); + if (ret == 0) + statfs2mnttab(&sfs, &entry); + else { (void) fprintf(stderr, "%s: %s\n", path, strerror(errno)); - ret = -1; } - statfs2mnttab(&sfs, &entry); } #endif /* sun */ if (ret != 0) { -- cgit v1.1