Source-Changes-HG archive

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

[src/trunk]: src/sys/kern PR/45545 Yui NARUSE: pipe2's return value is wrong



details:   https://anonhg.NetBSD.org/src/rev/cb51cd14cd34
branches:  trunk
changeset: 770756:cb51cd14cd34
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 31 21:31:29 2011 +0000

description:
PR/45545 Yui NARUSE: pipe2's return value is wrong

diffstat:

 sys/kern/sys_descrip.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r fb480a3c9418 -r cb51cd14cd34 sys/kern/sys_descrip.c
--- a/sys/kern/sys_descrip.c    Mon Oct 31 21:30:16 2011 +0000
+++ b/sys/kern/sys_descrip.c    Mon Oct 31 21:31:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_descrip.c,v 1.22 2011/06/26 16:42:42 christos Exp $        */
+/*     $NetBSD: sys_descrip.c,v 1.23 2011/10/31 21:31:29 christos Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.22 2011/06/26 16:42:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.23 2011/10/31 21:31:29 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -759,5 +759,8 @@
                return error;
        fd[0] = retval[0];
        fd[1] = retval[1];
-       return copyout(fd, SCARG(uap, fildes), sizeof(fd));
+       if ((error = copyout(fd, SCARG(uap, fildes), sizeof(fd))) != 0)
+               return error;
+       retval[0] = 0;
+       return 0;
 }



Home | Main Index | Thread Index | Old Index