[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/26] qemu-user: use exit(EXIT_SUCCESS) and exit(EX
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PATCH 09/26] qemu-user: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE) |
Date: |
Fri, 16 Sep 2016 15:56:00 +0200 |
This patch is the result of coccinelle script
scripts/coccinelle/exit.cocci
Signed-off-by: Laurent Vivier <address@hidden>
CC: Riku Voipio <address@hidden>
---
bsd-user/main.c | 20 ++++++++++----------
linux-user/main.c | 4 ++--
linux-user/syscall.c | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 0fb08e4..e47e4d7 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -658,7 +658,7 @@ void cpu_loop(CPUSPARCState *env)
#endif
printf ("Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, fprintf, 0);
- exit (1);
+ exit(EXIT_FAILURE);
}
process_pending_signals (env);
}
@@ -708,7 +708,7 @@ static void usage(void)
TARGET_NAME,
interp_prefix,
x86_stack_size);
- exit(1);
+ exit(EXIT_FAILURE);
}
THREAD CPUState *thread_cpu;
@@ -752,7 +752,7 @@ int main(int argc, char **argv)
if ((envlist = envlist_create()) == NULL) {
(void) fprintf(stderr, "Unable to allocate envlist\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* add current environment into the list */
@@ -793,7 +793,7 @@ int main(int argc, char **argv)
envlist_free(envlist);
if ((envlist = envlist_create()) == NULL) {
(void) fprintf(stderr, "Unable to allocate envlist\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
} else if (!strcmp(r, "U")) {
r = argv[optind++];
@@ -815,7 +815,7 @@ int main(int argc, char **argv)
if (qemu_host_page_size == 0 ||
(qemu_host_page_size & (qemu_host_page_size - 1)) != 0) {
fprintf(stderr, "page size must be a power of two\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
} else if (!strcmp(r, "g")) {
gdbstub_port = atoi(argv[optind++]);
@@ -828,7 +828,7 @@ int main(int argc, char **argv)
#if defined(cpu_list)
cpu_list(stdout, &fprintf);
#endif
- exit(1);
+ exit(EXIT_FAILURE);
}
} else if (!strcmp(r, "B")) {
guest_base = strtol(argv[optind++], NULL, 0);
@@ -867,7 +867,7 @@ int main(int argc, char **argv)
mask = qemu_str_to_log_mask(log_mask);
if (!mask) {
qemu_print_log_usage(stdout);
- exit(1);
+ exit(EXIT_FAILURE);
}
qemu_set_log(mask);
}
@@ -878,7 +878,7 @@ int main(int argc, char **argv)
filename = argv[optind];
if (!trace_init_backends()) {
- exit(1);
+ exit(EXIT_FAILURE);
}
trace_init_file(trace_file);
@@ -914,7 +914,7 @@ int main(int argc, char **argv)
cpu = cpu_init(cpu_model);
if (!cpu) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = cpu->env_ptr;
#if defined(TARGET_SPARC) || defined(TARGET_PPC)
@@ -1010,7 +1010,7 @@ int main(int argc, char **argv)
/* enable 64 bit mode if possible */
if (!(env->features[FEAT_8000_0001_EDX] & CPUID_EXT2_LM)) {
fprintf(stderr, "The selected x86 CPU does not support 64 bit mode\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env->cr[4] |= CR4_PAE_MASK;
env->efer |= MSR_EFER_LMA | MSR_EFER_LME;
diff --git a/linux-user/main.c b/linux-user/main.c
index 3ad70f8..0ab5360 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4243,7 +4243,7 @@ int main(int argc, char **argv, char **envp)
optind = parse_args(argc, argv);
if (!trace_init_backends()) {
- exit(1);
+ exit(EXIT_FAILURE);
}
trace_init_file(trace_file);
@@ -4700,7 +4700,7 @@ int main(int argc, char **argv, char **envp)
if ((env->active_fpu.fcr31_rw_bitmask &
(1 << FCR31_NAN2008)) == 0) {
fprintf(stderr, "ELF binary's NaN mode not supported by
CPU\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
if ((info->elf_flags & EF_MIPS_NAN2008) != 0) {
env->active_fpu.fcr31 |= (1 << FCR31_NAN2008);
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ca06943..da1f581 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6513,7 +6513,7 @@ void syscall_init(void)
if (arg_type[0] != TYPE_PTR) {
fprintf(stderr, "cannot patch size for ioctl 0x%x\n",
ie->target_cmd);
- exit(1);
+ exit(EXIT_FAILURE);
}
arg_type++;
size = thunk_type_size(arg_type, 0);
--
2.5.5
- [Qemu-devel] [PATCH 19/26] alpha: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), (continued)
- [Qemu-devel] [PATCH 19/26] alpha: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 13/26] sh4: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 10/26] m68k: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 18/26] posix: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 25/26] hw: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 14/26] x86: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 05/26] ppc: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 03/26] cris: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 09/26] qemu-user: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE),
Laurent Vivier <=
- [Qemu-devel] [PATCH 24/26] error, trace: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 01/26] coccinelle: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 04/26] block: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 02/26] arm: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 17/26] tcg: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 15/26] mips: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16
- [Qemu-devel] [PATCH 21/26] misc machine: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE), Laurent Vivier, 2016/09/16