Silence 'old_umask' uninit variable warning
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 29 Apr 2013 21:07:46 +0000 (14:07 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 May 2013 00:05:58 +0000 (17:05 -0700)
Recent changes have caused older versions of gcc to mistakenly
flag 'old_umask' in vn_open() as an unitialized variable.  To
silence the warning initialize it.

  kernel.c: In function 'vn_open':
  kernel.c:525:6: error: 'old_umask' may be used uninitialized
  in this function

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
lib/libzpool/kernel.c

index c1ce82d..f7aeeb4 100644 (file)
@@ -522,7 +522,7 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3)
 {
        int fd;
        vnode_t *vp;
-       int old_umask;
+       int old_umask = 0;
        char *realpath;
        struct stat64 st;
        int err;