Module Name: src Committed By: uebayasi Date: Fri Apr 11 18:02:33 UTC 2014
Modified Files: src/sys/kern: kern_exec.c Log Message: Reorder a new lines. Comments. To generate a diff of this commit: cvs rdiff -u -r1.384 -r1.385 src/sys/kern/kern_exec.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/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.384 src/sys/kern/kern_exec.c:1.385 --- src/sys/kern/kern_exec.c:1.384 Fri Apr 11 17:28:24 2014 +++ src/sys/kern/kern_exec.c Fri Apr 11 18:02:33 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.384 2014/04/11 17:28:24 uebayasi Exp $ */ +/* $NetBSD: kern_exec.c,v 1.385 2014/04/11 18:02:33 uebayasi Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.384 2014/04/11 17:28:24 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.385 2014/04/11 18:02:33 uebayasi Exp $"); #include "opt_exec.h" #include "opt_execfmt.h" @@ -681,6 +681,7 @@ execve_loadvm(struct lwp *l, const char } /* XXX -- THE FOLLOWING SECTION NEEDS MAJOR CLEANUP */ + /* XXX rename this as copyinargs() */ /* allocate an argument buffer */ data->ed_argp = pool_get(&exec_pool, PR_WAITOK); @@ -909,7 +910,6 @@ execve_runproc(struct lwp *l, struct exe struct exec_package * const epp = &data->ed_pack; int error = 0; struct proc *p; - struct vmspace *vm; /* * In case of a posix_spawn operation, the child doing the exec @@ -958,6 +958,7 @@ execve_runproc(struct lwp *l, struct exe p->p_textvp = epp->ep_vp; /* Now map address space */ + struct vmspace *vm; vm = p->p_vmspace; vm->vm_taddr = (void *)epp->ep_taddr; vm->vm_tsize = btoc(epp->ep_tsize); @@ -1058,10 +1059,6 @@ execve_runproc(struct lwp *l, struct exe } } - /* remember information about the process */ - data->ed_arginfo.ps_nargvstr = data->ed_argc; - data->ed_arginfo.ps_nenvstr = data->ed_envc; - { const char *commandname; size_t commandlen; @@ -1115,6 +1112,10 @@ execve_runproc(struct lwp *l, struct exe } } + /* remember information about the process */ + data->ed_arginfo.ps_nargvstr = data->ed_argc; + data->ed_arginfo.ps_nenvstr = data->ed_envc; + { char *stack; @@ -1510,6 +1511,8 @@ execve1(struct lwp *l, const char *path, /* * Copy argv and env strings from kernel buffer (argp) to the new stack. * Those strings are located just after auxinfo. + * + * XXX rename this as copyoutargs() */ int copyargs(struct lwp *l, struct exec_package *pack, struct ps_strings *arginfo, @@ -1535,6 +1538,7 @@ copyargs(struct lwp *l, struct exec_pack 1 + /* \0 */ envc + /* *env[] */ 1 + /* \0 */ + /* XXX auxinfo multiplied by ptr size? */ pack->ep_esch->es_arglen); /* auxinfo */ sp = argp;