diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2008-02-04 22:30:35 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 09:44:24 -0800 |
commit | c9a3072d13e4b8a6549ecc1db6390a55c7ee2ddf (patch) | |
tree | 7b3eee2e8b71d844b27ed6a1c8d852915934e7f9 /arch/um/os-Linux/main.c | |
parent | 4d18de45fa921600e1b3770c3a7cb106ab48cd9d (diff) |
uml: code tidying under arch/um/os-Linux
This patch contains varied fixes and improvements for some files under
arch/um/os-Linux/, such as a typo fix in a perror message, a missing
argument fix for a printf, some constifying for pointers and so on.
[ jdike - made sigprocmask failure return -errno instead of -1 ]
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
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/main.c')
-rw-r--r-- | arch/um/os-Linux/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 82c3778627b..de664e7ff31 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -73,7 +73,7 @@ static void install_fatal_handler(int sig) action.sa_handler = last_ditch_exit; if (sigaction(sig, &action, NULL) < 0) { printf("failed to install handler for signal %d - errno = %d\n", - errno); + sig, errno); exit(1); } } @@ -92,7 +92,8 @@ static void setup_env_path(void) * just use the default + /usr/lib/uml */ if (!old_path || (path_len = strlen(old_path)) == 0) { - putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH); + if (putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH)) + perror("couldn't putenv"); return; } @@ -100,11 +101,14 @@ static void setup_env_path(void) path_len += strlen("PATH=" UML_LIB_PATH) + 1; new_path = malloc(path_len); if (!new_path) { - perror("coudn't malloc to set a new PATH"); + perror("couldn't malloc to set a new PATH"); return; } snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path); - putenv(new_path); + if (putenv(new_path)) { + perror("couldn't putenv to set a new PATH"); + free(new_path); + } } extern int uml_exitcode; |