diff options
Diffstat (limited to 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/net_user.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/slip_user.c | 12 | ||||
-rw-r--r-- | arch/um/drivers/slirp_user.c | 15 | ||||
-rw-r--r-- | arch/um/drivers/ubd_user.c | 3 |
4 files changed, 7 insertions, 25 deletions
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c index 90d7f2e8ead8..29185cad9fff 100644 --- a/arch/um/drivers/net_user.c +++ b/arch/um/drivers/net_user.c @@ -201,7 +201,7 @@ static int change_tramp(char **argv, char *output, int output_len) close(fds[1]); if (pid > 0) - CATCH_EINTR(err = waitpid(pid, NULL, 0)); + helper_wait(pid, 0, "change_tramp"); return pid; } diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c index 5f06204d6871..b8711e50da80 100644 --- a/arch/um/drivers/slip_user.c +++ b/arch/um/drivers/slip_user.c @@ -77,7 +77,7 @@ static int slip_tramp(char **argv, int fd) { struct slip_pre_exec_data pe_data; char *output; - int status, pid, fds[2], err, output_len; + int pid, fds[2], err, output_len; err = os_pipe(fds, 1, 0); if (err < 0) { @@ -109,15 +109,7 @@ static int slip_tramp(char **argv, int fd) read_output(fds[0], output, output_len); printk("%s", output); - CATCH_EINTR(err = waitpid(pid, &status, 0)); - if (err < 0) - err = errno; - else if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) { - printk(UM_KERN_ERR "'%s' didn't exit with status 0\n", argv[0]); - err = -EINVAL; - } - else err = 0; - + err = helper_wait(pid, 0, argv[0]); close(fds[0]); out_free: diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c index 1865089ff41a..89c1be225fda 100644 --- a/arch/um/drivers/slirp_user.c +++ b/arch/um/drivers/slirp_user.c @@ -79,7 +79,7 @@ out: static void slirp_close(int fd, void *data) { struct slirp_data *pri = data; - int status,err; + int err; close(fd); close(pri->slave); @@ -98,18 +98,9 @@ static void slirp_close(int fd, void *data) "(%d)\n", pri->pid, errno); } #endif - - CATCH_EINTR(err = waitpid(pri->pid, &status, WNOHANG)); - if (err < 0) { - printk(UM_KERN_ERR "slirp_close: waitpid returned %d\n", errno); - return; - } - - if (err == 0) { - printk(UM_KERN_ERR "slirp_close: process %d has not exited\n", - pri->pid); + err = helper_wait(pri->pid, 1, "slirp_close"); + if (err < 0) return; - } pri->pid = -1; } diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c index 41d254bd38df..48fc7452bc1d 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c @@ -49,8 +49,7 @@ int start_io_thread(unsigned long sp, int *fd_out) goto out_close; } - pid = clone(io_thread, (void *) sp, CLONE_FILES | CLONE_VM | SIGCHLD, - NULL); + pid = clone(io_thread, (void *) sp, CLONE_FILES | CLONE_VM, NULL); if(pid < 0){ err = -errno; printk("start_io_thread - clone failed : errno = %d\n", errno); |