aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/skas/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/skas/process.c')
-rw-r--r--arch/um/os-Linux/skas/process.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index d77c81d7068a..e8b7a97e83d3 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -64,7 +64,7 @@ void wait_stub_done(int pid)
64 int n, status, err; 64 int n, status, err;
65 65
66 while (1) { 66 while (1) {
67 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 67 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL));
68 if ((n < 0) || !WIFSTOPPED(status)) 68 if ((n < 0) || !WIFSTOPPED(status))
69 goto bad_wait; 69 goto bad_wait;
70 70
@@ -153,7 +153,7 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
153 panic("handle_trap - continuing to end of syscall " 153 panic("handle_trap - continuing to end of syscall "
154 "failed, errno = %d\n", errno); 154 "failed, errno = %d\n", errno);
155 155
156 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED)); 156 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
157 if ((err < 0) || !WIFSTOPPED(status) || 157 if ((err < 0) || !WIFSTOPPED(status) ||
158 (WSTOPSIG(status) != SIGTRAP + 0x80)) { 158 (WSTOPSIG(status) != SIGTRAP + 0x80)) {
159 err = ptrace_dump_regs(pid); 159 err = ptrace_dump_regs(pid);
@@ -255,16 +255,18 @@ int start_userspace(unsigned long stub_stack)
255 panic("start_userspace : mmap failed, errno = %d", errno); 255 panic("start_userspace : mmap failed, errno = %d", errno);
256 sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *); 256 sp = (unsigned long) stack + UM_KERN_PAGE_SIZE - sizeof(void *);
257 257
258 flags = CLONE_FILES | SIGCHLD; 258 flags = CLONE_FILES;
259 if (proc_mm) 259 if (proc_mm)
260 flags |= CLONE_VM; 260 flags |= CLONE_VM;
261 else
262 flags |= SIGCHLD;
261 263
262 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack); 264 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack);
263 if (pid < 0) 265 if (pid < 0)
264 panic("start_userspace : clone failed, errno = %d", errno); 266 panic("start_userspace : clone failed, errno = %d", errno);
265 267
266 do { 268 do {
267 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED)); 269 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL));
268 if (n < 0) 270 if (n < 0)
269 panic("start_userspace : wait failed, errno = %d", 271 panic("start_userspace : wait failed, errno = %d",
270 errno); 272 errno);
@@ -314,7 +316,7 @@ void userspace(struct uml_pt_regs *regs)
314 "pid=%d, ptrace operation = %d, errno = %d\n", 316 "pid=%d, ptrace operation = %d, errno = %d\n",
315 pid, op, errno); 317 pid, op, errno);
316 318
317 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED)); 319 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
318 if (err < 0) 320 if (err < 0)
319 panic("userspace - waitpid failed, errno = %d\n", 321 panic("userspace - waitpid failed, errno = %d\n",
320 errno); 322 errno);