diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2017-05-17 19:19:31 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2017-07-05 23:18:25 +0200 |
commit | 0936d4f3d5a3d5daf453bc341f02ba4e68cfe40e (patch) | |
tree | 494fd5cbbfe856c4677abf14b717313da76c2819 /arch/um/os-Linux/mem.c | |
parent | um: Add os_warn() for pre-boot warning/error messages (diff) | |
download | linux-0936d4f3d5a3d5daf453bc341f02ba4e68cfe40e.tar.xz linux-0936d4f3d5a3d5daf453bc341f02ba4e68cfe40e.zip |
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>
Diffstat (limited to 'arch/um/os-Linux/mem.c')
-rw-r--r-- | arch/um/os-Linux/mem.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index a7f6023301cd..e162a95ad7dd 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c @@ -82,7 +82,7 @@ static char * __init choose_tempdir(void) dir = fallback_dir; warn: - printf("Warning: tempdir %s is not on tmpfs\n", dir); + os_warn("Warning: tempdir %s is not on tmpfs\n", dir); done: /* Make a copy since getenv results may not remain valid forever. */ return strdup(dir); @@ -100,7 +100,7 @@ static int __init make_tempfile(const char *template) if (tempdir == NULL) { tempdir = choose_tempdir(); if (tempdir == NULL) { - fprintf(stderr, "Failed to choose tempdir: %s\n", + os_warn("Failed to choose tempdir: %s\n", strerror(errno)); return -1; } @@ -125,7 +125,7 @@ static int __init make_tempfile(const char *template) strcat(tempname, template); fd = mkstemp(tempname); if (fd < 0) { - fprintf(stderr, "open - cannot create %s: %s\n", tempname, + os_warn("open - cannot create %s: %s\n", tempname, strerror(errno)); goto out; } @@ -197,10 +197,10 @@ void __init check_tmpexec(void) os_info("Checking PROT_EXEC mmap in %s...", tempdir); if (addr == MAP_FAILED) { err = errno; - printf("%s\n", strerror(err)); + os_warn("%s\n", strerror(err)); close(fd); if (err == EPERM) - printf("%s must be not mounted noexec\n", tempdir); + os_warn("%s must be not mounted noexec\n", tempdir); exit(1); } os_info("OK\n"); |