linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Jeff Dike <jdike@addtoit.com>, Richard Weinberger <richard@nod.at>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 5/7] um: Print out fatal error in stderr
Date: Fri, 28 Apr 2017 19:25:39 +0900	[thread overview]
Message-ID: <149337512938.14717.12152115985265749215.stgit@devbox> (raw)
In-Reply-To: <149337478135.14717.16640886389891283.stgit@devbox>

Print out fatal error in stderr as same as fatal() does.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/um/kernel/physmem.c |    8 ++++----
 arch/um/kernel/um_arch.c |    2 +-
 arch/um/os-Linux/main.c  |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 4c9861b..7f95329 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -89,8 +89,8 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 	offset = uml_reserved - uml_physmem;
 	map_size = len - offset;
 	if(map_size <= 0) {
-		printf("Too few physical memory! Needed=%d, given=%d\n",
-		       offset, len);
+		fprintf(stderr, "Too few physical memory! Needed=%d, "
+			"given=%d\n", offset, len);
 		exit(1);
 	}
 
@@ -99,8 +99,8 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 	err = os_map_memory((void *) uml_reserved, physmem_fd, offset,
 			    map_size, 1, 1, 1);
 	if (err < 0) {
-		printf("setup_physmem - mapping %ld bytes of memory at 0x%p "
-		       "failed - errno = %d\n", map_size,
+		fprintf(stderr, "setup_physmem - mapping %ld bytes of memory "
+			"at 0x%p failed - errno = %d\n", map_size,
 		       (void *) uml_reserved, err);
 		exit(1);
 	}
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index b3b28db..01817d6 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -34,7 +34,7 @@ static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 };
 static void __init add_arg(char *arg)
 {
 	if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) {
-		printf("add_arg: Too many command line arguments!\n");
+		fprintf(stderr, "add_arg: Too many command line arguments!\n");
 		exit(1);
 	}
 	if (strlen(command_line) > 0)
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 659fee3..09b44f1 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -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);
+		fprintf(stderr, "failed to install handler for signal %d "
+			"- errno = %d\n", sig, errno);
 		exit(1);
 	}
 }

  parent reply	other threads:[~2017-04-28 10:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 10:19 [RFC PATCH 0/7] um: Fix printf usage and support quiet option Masami Hiramatsu
2017-04-28 10:21 ` [RFC PATCH 1/7] um: Use printk instead of printf in make_uml_dir Masami Hiramatsu
2017-04-28 10:22 ` [RFC PATCH 2/7] um: Use non_fatal() in check_coredump_limit Masami Hiramatsu
2017-04-28 10:23 ` [RFC PATCH 3/7] um: Make non_fatal non-static for other files Masami Hiramatsu
2017-04-28 10:24 ` [RFC PATCH 4/7] um: Use non_fatal() for non-fatal information/warning messages Masami Hiramatsu
2017-04-28 10:25 ` Masami Hiramatsu [this message]
2017-04-29 11:26   ` [RFC PATCH 5/7] um: Print out fatal error in stderr Masami Hiramatsu
2017-04-28 10:26 ` [RFC PATCH 6/7] um: Suppress non-fatal messages when quiet Masami Hiramatsu
2017-04-28 10:27 ` [RFC PATCH 7/7] um: console: Ignore console= option Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=149337512938.14717.12152115985265749215.stgit@devbox \
    --to=mhiramat@kernel.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).