Fix 'zfs list <path>' handling. If the path was found, the 'ret' variable was

uninitialized.

PR:		kern/155940
Submitted by:	KOIE Hidetaka <koie@suri.co.jp>
MFC after:	1 week
This commit is contained in:
Pawel Jakub Dawidek 2011-04-12 20:31:33 +00:00
parent 649fde88ff
commit 73aab6768c

View File

@ -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) {