Fix uninitialized varible in zfs_do_userspace()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 27 Sep 2011 23:32:53 +0000 (16:32 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 27 Sep 2011 23:56:38 +0000 (16:56 -0700)
When compiling under Debian Lenny with gcc version 4.3.2
(Debian 4.3.2-1.1) the following warning occurs.  To quiet
the warning initialize 'error' to zero.  Newer versions of
gcc correctly determine that this uninitialized varible is
impossible because ZFS_NUM_USERQUOTA_PROPS is known to be
greater than zero.

  cmd/zfs/zfs_main.c:2377: warning: "error" may be
  used uninitialized in this function

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
cmd/zfs/zfs_main.c

index 82a6d56..a052be5 100644 (file)
@@ -2374,7 +2374,7 @@ zfs_do_userspace(int argc, char **argv)
        boolean_t prtnum = B_FALSE;
        boolean_t parseable = B_FALSE;
        boolean_t sid2posix = B_FALSE;
-       int error;
+       int error = 0;
        int c;
        zfs_sort_column_t *default_sortcol = NULL;
        zfs_sort_column_t *sortcol = NULL;