Author: pjd
Date: Tue Apr 12 20:31:33 2011
New Revision: 220575
URL: http://svn.freebsd.org/changeset/base/220575

Log:
  Fix 'zfs list <path>' handling. If the path was found, the 'ret' variable was
  uninitialized.
  
  PR:           kern/155940
  Submitted by: KOIE Hidetaka <k...@suri.co.jp>
  MFC after:    1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c       Tue Apr 
12 20:10:15 2011        (r220574)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c       Tue Apr 
12 20:31:33 2011        (r220575)
@@ -734,12 +734,13 @@ zfs_path_to_zhandle(libzfs_handle_t *hdl
        {
                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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to