Module Name:    src
Committed By:   christos
Date:           Mon Oct 31 21:31:29 UTC 2011

Modified Files:
        src/sys/kern: sys_descrip.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/sys_descrip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_descrip.c
diff -u src/sys/kern/sys_descrip.c:1.22 src/sys/kern/sys_descrip.c:1.23
--- src/sys/kern/sys_descrip.c:1.22	Sun Jun 26 12:42:42 2011
+++ src/sys/kern/sys_descrip.c	Mon Oct 31 17:31:29 2011
@@ -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 @@ sys_pipe2(struct lwp *l, const struct sy
 		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;
 }

Reply via email to