Commit 626c59f5 authored by WANG Cong's avatar WANG Cong Committed by Linus Torvalds

arch/um/os-Linux/start_up.c: various improvements.

 - lets ptrace_child become void
 - adds checking for the return value of change_sig
 - moves errors info into stderr instead of stdout.

Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarWANG Cong <wangcong@zeuux.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3595726a
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
#include "registers.h" #include "registers.h"
#include "skas_ptrace.h" #include "skas_ptrace.h"
static int ptrace_child(void) static void ptrace_child(void)
{ {
int ret; int ret;
/* Calling os_getpid because some libcs cached getpid incorrectly */ /* Calling os_getpid because some libcs cached getpid incorrectly */
int pid = os_getpid(), ppid = getppid(); int pid = os_getpid(), ppid = getppid();
int sc_result; int sc_result;
change_sig(SIGWINCH, 0); if (change_sig(SIGWINCH, 0) < 0 ||
if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) {
perror("ptrace"); perror("ptrace");
kill(pid, SIGKILL); kill(pid, SIGKILL);
} }
...@@ -75,9 +75,8 @@ static void fatal(char *fmt, ...) ...@@ -75,9 +75,8 @@ static void fatal(char *fmt, ...)
va_list list; va_list list;
va_start(list, fmt); va_start(list, fmt);
vprintf(fmt, list); vfprintf(stderr, fmt, list);
va_end(list); va_end(list);
fflush(stdout);
exit(1); exit(1);
} }
...@@ -87,9 +86,8 @@ static void non_fatal(char *fmt, ...) ...@@ -87,9 +86,8 @@ static void non_fatal(char *fmt, ...)
va_list list; va_list list;
va_start(list, fmt); va_start(list, fmt);
vprintf(fmt, list); vfprintf(stderr, fmt, list);
va_end(list); va_end(list);
fflush(stdout);
} }
static int start_ptraced_child(void) static int start_ptraced_child(void)
...@@ -495,7 +493,7 @@ int __init parse_iomem(char *str, int *add) ...@@ -495,7 +493,7 @@ int __init parse_iomem(char *str, int *add)
driver = str; driver = str;
file = strchr(str,','); file = strchr(str,',');
if (file == NULL) { if (file == NULL) {
printf("parse_iomem : failed to parse iomem\n"); fprintf(stderr, "parse_iomem : failed to parse iomem\n");
goto out; goto out;
} }
*file = '\0'; *file = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment