Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35700
b: refs/heads/master
c: 6b7aaad
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Sep 26, 2006
1 parent 33a39e1 commit 3c84814
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e1f65a67d76341795ea527d30bfdca03999d46b
refs/heads/master: 6b7aaad9ba4f2a059a70014be12a921eceebfc47
22 changes: 11 additions & 11 deletions trunk/arch/um/os-Linux/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int helper_child(void *arg)
if(data->pre_exec != NULL)
(*data->pre_exec)(data->pre_data);
execvp(argv[0], argv);
errval = errno;
errval = -errno;
printk("helper_child - execve of '%s' failed - errno = %d\n", argv[0], errno);
os_write_file(data->fd, &errval, sizeof(errval));
kill(os_getpid(), SIGKILL);
Expand All @@ -62,7 +62,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
stack = *stack_out;
else stack = alloc_stack(0, __cant_sleep());
if(stack == 0)
return(-ENOMEM);
return -ENOMEM;

ret = os_pipe(fds, 1, 0);
if(ret < 0){
Expand Down Expand Up @@ -95,16 +95,16 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv,
/* Read the errno value from the child, if the exec failed, or get 0 if
* the exec succeeded because the pipe fd was set as close-on-exec. */
n = os_read_file(fds[0], &ret, sizeof(ret));
if (n < 0) {
printk("run_helper : read on pipe failed, ret = %d\n", -n);
ret = n;
kill(pid, SIGKILL);
CATCH_EINTR(waitpid(pid, NULL, 0));
} else if(n != 0){
CATCH_EINTR(n = waitpid(pid, NULL, 0));
ret = -errno;
} else {
if(n == 0)
ret = pid;
else {
if(n < 0){
printk("run_helper : read on pipe failed, ret = %d\n",
-n);
ret = n;
kill(pid, SIGKILL);
}
CATCH_EINTR(waitpid(pid, NULL, 0));
}

out_close:
Expand Down

0 comments on commit 3c84814

Please sign in to comment.