diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-05-06 17:51:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:13:03 -0400 |
commit | ef0470c053274c343b2be8737e0146d65e17f9be (patch) | |
tree | 68809a8af1da35e3bb3530a667eea080e086fae0 /arch/um/os-Linux/helper.c | |
parent | 3d564047a5f45cb628ec72514f68076e532988f3 (diff) |
uml: tidy libc code
This patch lays some groundwork for the next one, which converts calls to
os_{read,write}_file into {read,write}, by doing some tidying in the affected
areas.
do_not_aio gets restructured to make the final result a bit cleaner.
There are also whitespace and other formatting fixes, fixes in error messages,
and a typo fix.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/helper.c')
-rw-r--r-- | arch/um/os-Linux/helper.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/um/os-Linux/helper.c b/arch/um/os-Linux/helper.c index 2184ddb9cb31..8a4c9e47326c 100644 --- a/arch/um/os-Linux/helper.c +++ b/arch/um/os-Linux/helper.c | |||
@@ -34,7 +34,8 @@ static int helper_child(void *arg) | |||
34 | if (data->pre_exec != NULL) | 34 | if (data->pre_exec != NULL) |
35 | (*data->pre_exec)(data->pre_data); | 35 | (*data->pre_exec)(data->pre_data); |
36 | errval = execvp_noalloc(data->buf, argv[0], argv); | 36 | errval = execvp_noalloc(data->buf, argv[0], argv); |
37 | printk("helper_child - execvp of '%s' failed - errno = %d\n", argv[0], -errval); | 37 | printk("helper_child - execvp of '%s' failed - errno = %d\n", argv[0], |
38 | -errval); | ||
38 | os_write_file(data->fd, &errval, sizeof(errval)); | 39 | os_write_file(data->fd, &errval, sizeof(errval)); |
39 | kill(os_getpid(), SIGKILL); | 40 | kill(os_getpid(), SIGKILL); |
40 | return 0; | 41 | return 0; |
@@ -87,8 +88,10 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, | |||
87 | close(fds[1]); | 88 | close(fds[1]); |
88 | fds[1] = -1; | 89 | fds[1] = -1; |
89 | 90 | ||
90 | /* Read the errno value from the child, if the exec failed, or get 0 if | 91 | /* |
91 | * the exec succeeded because the pipe fd was set as close-on-exec. */ | 92 | * Read the errno value from the child, if the exec failed, or get 0 if |
93 | * the exec succeeded because the pipe fd was set as close-on-exec. | ||
94 | */ | ||
92 | n = os_read_file(fds[0], &ret, sizeof(ret)); | 95 | n = os_read_file(fds[0], &ret, sizeof(ret)); |
93 | if (n == 0) { | 96 | if (n == 0) { |
94 | ret = pid; | 97 | ret = pid; |