diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2015-05-25 20:44:46 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2015-05-25 20:44:46 +0000 |
commit | d707582f83d003562a261106fb43b0eaedbe0a68 (patch) | |
tree | b5d5457fce8138b09a5295e94fb2db013079d740 | |
parent | 781eb7444e5b58344a233e1ed3f96ed145e4a493 (diff) |
Notes
-rw-r--r-- | sys/amd64/linux32/linux32_machdep.c | 9 | ||||
-rw-r--r-- | sys/compat/linux/linux_emul.c | 18 | ||||
-rw-r--r-- | sys/i386/linux/linux_machdep.c | 9 |
3 files changed, 5 insertions, 31 deletions
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 0bcc4d36047d..f9c11ca797fd 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -126,7 +126,6 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - struct vmspace *oldvmspace; char *path; int error; @@ -137,19 +136,11 @@ linux_execve(struct thread *td, struct linux_execve_args *args) printf(ARGS(execve, "%s"), path); #endif - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(path, M_TEMP); - return (error); - } error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); - if (error == 0) error = linux_common_execve(td, &eargs); - post_execve(td, error, oldvmspace); return (error); } diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 002372798a6d..a28da8d5b5d3 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -172,27 +172,19 @@ linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; struct epoll_emuldata *emd; + struct vmspace *oldvmspace; struct linux_emuldata *em; struct proc *p; int error; p = td->td_proc; - /* - * Unlike FreeBSD abort all other threads before - * proceeding exec. - */ - PROC_LOCK(p); - /* See exit1() comments. */ - thread_suspend_check(0); - while (p->p_flag & P_HADTHREADS) { - if (!thread_single(p, SINGLE_EXIT)) - break; - thread_suspend_check(0); - } - PROC_UNLOCK(p); + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = kern_execve(td, eargs, NULL); + post_execve(td, error, oldvmspace); if (error != 0) return (error); diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 784a621ebdcd..c9f969bed7f1 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -104,7 +104,6 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - struct vmspace *oldvmspace; char *newpath; int error; @@ -115,19 +114,11 @@ linux_execve(struct thread *td, struct linux_execve_args *args) printf(ARGS(execve, "%s"), newpath); #endif - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(newpath, M_TEMP); - return (error); - } error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE, args->argp, args->envp); free(newpath, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); - if (error == 0) error = linux_common_execve(td, &eargs); - post_execve(td, error, oldvmspace); return (error); } |