stat: propogate EFAULT errors
authorAlan Cox <alan@linux.intel.com>
Sat, 16 May 2015 15:46:00 +0000 (16:46 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 16 May 2015 15:46:00 +0000 (16:46 +0100)
Kernel/syscall_fs.c

index 24a6265..aef1df8 100644 (file)
@@ -111,11 +111,12 @@ arg_t _sync(void)
 arg_t _stat(void)
 {
        inoptr ino;
+       int err;
        if (!(ino = n_open(path, NULLINOPTR)))
                return (-1);
-       stcpy(ino, buf);
+       err = stcpy(ino, buf);
        i_deref(ino);
-       return (0);
+       return err;
 }
 
 #undef path