summaryrefslogtreecommitdiffstats
path: root/bsd-user
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-02 13:24:37 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-02 13:26:59 +0100
commit9bb931802e6ab5ab6947e3cb9cea934fc0724274 (patch)
treefe6e1d0ffaed3979e4ddbb60427b1a18a995c845 /bsd-user
parentd7d3d6092cb7edc75dc49fb90c86dd5425ab4805 (diff)
downloadhqemu-9bb931802e6ab5ab6947e3cb9cea934fc0724274.zip
hqemu-9bb931802e6ab5ab6947e3cb9cea934fc0724274.tar.gz
Revert "bsd-user: replace fprintf(stderr, ...) with error_report()"
This reverts commit 1fba509527beb74bdcf50bc07ad3cd8244ad9c61. That commit converted various fprintf(stderr, ...) calls to use error_report(); however none of these bsd-user files include a header which gives a prototype for error_report, so this causes compiler warnings. Since these are just straightforward reporting of command line errors, we should handle these in the obvious way by printing to stderr, as we do for linux-user. There's no need to drag in the error-handling framework for this, especially since user-mode doesn't have the "maybe we need to send this to the monitor" issues system emulation does. Acked-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'bsd-user')
-rw-r--r--bsd-user/bsdload.c2
-rw-r--r--bsd-user/elfload.c2
-rw-r--r--bsd-user/main.c14
3 files changed, 9 insertions, 9 deletions
diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index 6b52e08..2abc713 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -183,7 +183,7 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
&& bprm.buf[3] == 'F') {
retval = load_elf_binary(&bprm,regs,infop);
} else {
- error_report("Unknown binary format");
+ fprintf(stderr, "Unknown binary format\n");
return -1;
}
}
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 95652b1..93fd9e4 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -628,7 +628,7 @@ static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,
while (argc-- > 0) {
tmp = argv[argc];
if (!tmp) {
- error_report("VFS: argc is wrong");
+ fprintf(stderr, "VFS: argc is wrong");
exit(-1);
}
tmp1 = tmp;
diff --git a/bsd-user/main.c b/bsd-user/main.c
index de74d17..4ba61da 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -378,8 +378,8 @@ void cpu_loop(CPUX86State *env)
#endif
default:
pc = env->segs[R_CS].base + env->eip;
- error_report("qemu: 0x%08lx: unhandled CPU exception 0x%x"
- " - aborting", (long)pc, trapnr);
+ fprintf(stderr, "qemu: 0x%08lx: unhandled CPU exception 0x%x - aborting\n",
+ (long)pc, trapnr);
abort();
}
process_pending_signals(env);
@@ -752,7 +752,7 @@ int main(int argc, char **argv)
module_call_init(MODULE_INIT_QOM);
if ((envlist = envlist_create()) == NULL) {
- error_report("Unable to allocate envlist");
+ (void) fprintf(stderr, "Unable to allocate envlist\n");
exit(1);
}
@@ -794,7 +794,7 @@ int main(int argc, char **argv)
} else if (!strcmp(r, "ignore-environment")) {
envlist_free(envlist);
if ((envlist = envlist_create()) == NULL) {
- error_report("Unable to allocate envlist");
+ (void) fprintf(stderr, "Unable to allocate envlist\n");
exit(1);
}
} else if (!strcmp(r, "U")) {
@@ -816,7 +816,7 @@ int main(int argc, char **argv)
qemu_host_page_size = atoi(argv[optind++]);
if (qemu_host_page_size == 0 ||
(qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
- error_report("page size must be a power of two");
+ fprintf(stderr, "page size must be a power of two\n");
exit(1);
}
} else if (!strcmp(r, "g")) {
@@ -910,7 +910,7 @@ int main(int argc, char **argv)
qemu_host_page_size */
env = cpu_init(cpu_model);
if (!env) {
- error_report("Unable to find CPU definition");
+ fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
cpu = ENV_GET_CPU(env);
@@ -1012,7 +1012,7 @@ int main(int argc, char **argv)
#ifndef TARGET_ABI32
/* enable 64 bit mode if possible */
if (!(env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM)) {
- error_report("The selected x86 CPU does not support 64 bit mode");
+ fprintf(stderr, "The selected x86 CPU does not support 64 bit mode\n");
exit(1);
}
env->cr[4] |= CR4_PAE_MASK;
OpenPOWER on IntegriCloud