Module Name:    src
Committed By:   christos
Date:           Fri Oct 24 21:07:55 UTC 2014

Modified Files:
        src/sys/compat/netbsd32: netbsd32_exec.h

Log Message:
sync with the regular method; no functional diff


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/netbsd32/netbsd32_exec.h

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_exec.h
diff -u src/sys/compat/netbsd32/netbsd32_exec.h:1.31 src/sys/compat/netbsd32/netbsd32_exec.h:1.32
--- src/sys/compat/netbsd32/netbsd32_exec.h:1.31	Thu Dec 10 09:13:53 2009
+++ src/sys/compat/netbsd32/netbsd32_exec.h	Fri Oct 24 17:07:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_exec.h,v 1.31 2009/12/10 14:13:53 matt Exp $	*/
+/*	$NetBSD: netbsd32_exec.h,v 1.32 2014/10/24 21:07:55 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -94,20 +94,28 @@ netbsd32_copyargs(struct lwp *l, struct 
 	int envc = arginfo->ps_nenvstr;
 	int error;
 
+	NETBSD32PTR32(dp, cpp + 
+	    1 +				/* int argc */
+	    argc +			/* char *argv[] */
+	    1 +				/* \0 */
+	    envc +			/* char *env[] */
+	    1 +				/* \0 */
+	    /* XXX auxinfo multiplied by ptr size? */
+	    pack->ep_esch->es_arglen);	/* auxinfo */
+	sp = argp;
+
 	if ((error = copyout(&argc, cpp++, sizeof(argc))) != 0)
 		return error;
 
-	NETBSD32PTR32(dp, cpp + argc + envc + 2 + pack->ep_esch->es_arglen);
-	sp = argp;
-
 	/* XXX don't copy them out, remap them! */
 	/* remember location of argv for later */
 	arginfo->ps_argvstr = (char **)(u_long)cpp;
 
 	for (; --argc >= 0; sp += len, NETBSD32PTR32PLUS(dp, len)) {
-		if ((error = copyout(&dp, cpp++, sizeof(dp))) != 0 ||
-		    (error = copyoutstr(sp, NETBSD32PTR64(dp),
-					ARG_MAX, &len)) != 0)
+		if ((error = copyout(&dp, cpp++, sizeof(dp))) != 0)
+			return error;
+		if ((error = copyoutstr(sp, NETBSD32PTR64(dp),
+		    ARG_MAX, &len)) != 0)
 			return error;
 	}
 	if ((error = copyout(&nullp, cpp++, sizeof(nullp))) != 0)
@@ -117,9 +125,10 @@ netbsd32_copyargs(struct lwp *l, struct 
 	arginfo->ps_envstr = (char **)(u_long)cpp;
 
 	for (; --envc >= 0; sp += len, NETBSD32PTR32PLUS(dp, len)) {
-		if ((error = copyout(&dp, cpp++, sizeof(dp))) != 0 ||
-		    (error = copyoutstr(sp, NETBSD32PTR64(dp),
-					ARG_MAX, &len)) != 0)
+		if ((error = copyout(&dp, cpp++, sizeof(dp))) != 0)
+			return error;
+		if ((error = copyoutstr(sp, NETBSD32PTR64(dp),
+		    ARG_MAX, &len)) != 0)
 			return error;
 	}
 	if ((error = copyout(&nullp, cpp++, sizeof(nullp))) != 0)

Reply via email to