um: Use os_warn to print out pre-boot warning/error messages

Use os_warn() instead of printf/fprintf to print out
pre-boot warning/error messages to stderr.
Note that the help message and version message are
kept to print out to stdout, because user explicitly
specifies those options to get such information.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Masami Hiramatsu 2017-05-18 02:19:31 +09:00 committed by Richard Weinberger
parent 721ccae88d
commit 0936d4f3d5
8 changed files with 26 additions and 24 deletions

View file

@ -74,8 +74,8 @@ static void install_fatal_handler(int sig)
action.sa_restorer = NULL;
action.sa_handler = last_ditch_exit;
if (sigaction(sig, &action, NULL) < 0) {
printf("failed to install handler for signal %d - errno = %d\n",
sig, errno);
os_warn("failed to install handler for signal %d "
"- errno = %d\n", sig, errno);
exit(1);
}
}
@ -175,7 +175,7 @@ int __init main(int argc, char **argv, char **envp)
/* disable SIGIO for the fds and set SIGIO to be ignored */
err = deactivate_all_fds();
if (err)
printf("deactivate_all_fds failed, errno = %d\n", -err);
os_warn("deactivate_all_fds failed, errno = %d\n", -err);
/*
* Let any pending signals fire now. This ensures