Module Name:    src
Committed By:   pooka
Date:           Mon Feb 21 11:29:53 UTC 2011

Modified Files:
        src/sys/kern: makesyscalls.sh

Log Message:
Make sure we don't expose any errno set as a side-effect of us
executing the system call.  Some software ignores the return value
and looks only at errno.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/kern/makesyscalls.sh

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/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.109 src/sys/kern/makesyscalls.sh:1.110
--- src/sys/kern/makesyscalls.sh:1.109	Mon Jan 17 16:16:54 2011
+++ src/sys/kern/makesyscalls.sh	Mon Feb 21 11:29:53 2011
@@ -1,5 +1,5 @@
 #! /bin/sh -
-#	$NetBSD: makesyscalls.sh,v 1.109 2011/01/17 16:16:54 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.110 2011/02/21 11:29:53 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -808,12 +808,10 @@
 	printf("\terror = rsys_syscall(%s%s%s, " \
 	    "%s, %s, rval);\n", constprefix, compatwrap_, funcalias, \
 	    argarg, argsize) > rumpcalls
-	printf("\tif (error) {\n\t\trval[0] = -1;\n") > rumpcalls
+	printf("\trsys_seterrno(error);\n") > rumpcalls
+	printf("\tif (error) {\n\t\trval[0] = -1;\n\t}\n") > rumpcalls
 	if (returntype != "void") {
-		printf("\t\trsys_seterrno(error);\n\t}\n") > rumpcalls
 		printf("\treturn rval[0];\n") > rumpcalls
-	} else {
-		printf("\t}\n") > rumpcalls
 	}
 	printf("}\n") > rumpcalls
 	printf("rsys_alias(%s%s,rump_enosys)\n", \

Reply via email to