Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/kern Pull up following revision(s) (requested by mart...



details:   https://anonhg.NetBSD.org/src/rev/0f43160c251a
branches:  netbsd-7
changeset: 799006:0f43160c251a
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Feb 18 06:35:58 2015 +0000

description:
Pull up following revision(s) (requested by martin in ticket #523):
        sys/kern/vfs_syscalls.c: revision 1.493
A syscall like posix_fallocate() that is not supposed to set errno in
userland needs to always return 0 and store the error code *retval.

diffstat:

 sys/kern/vfs_syscalls.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 41ddfc9e9125 -r 0f43160c251a sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Tue Feb 17 15:30:34 2015 +0000
+++ b/sys/kern/vfs_syscalls.c   Wed Feb 18 06:35:58 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.490.2.1 2014/12/01 09:54:50 martin Exp $    */
+/*     $NetBSD: vfs_syscalls.c,v 1.490.2.2 2015/02/18 06:35:58 snj Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.490.2.1 2014/12/01 09:54:50 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.490.2.2 2015/02/18 06:35:58 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -4716,12 +4716,14 @@
        len = SCARG(uap, len);
        
        if (pos < 0 || len < 0 || len > OFF_T_MAX - pos) {
-               return EINVAL;
+               *retval = EINVAL;
+               return 0;
        }
        
        error = fd_getvnode(fd, &fp);
        if (error) {
-               return error;
+               *retval = error;
+               return 0;
        }
        if ((fp->f_flag & FWRITE) == 0) {
                error = EBADF;
@@ -4739,7 +4741,8 @@
 
 fail:
        fd_putfile(fd);
-       return error;
+       *retval = error;
+       return 0;
 }
 
 /*



Home | Main Index | Thread Index | Old Index