diff mbox

[17/26] tcg: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)

Message ID 1474034177-17663-18-git-send-email-lvivier@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Vivier Sept. 16, 2016, 1:56 p.m. UTC
This patch is the result of coccinelle script
scripts/coccinelle/exit.cocci

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
CC: Richard Henderson <rth@twiddle.net>
---
 cpus.c          | 16 ++++++++--------
 cputlb.c        |  2 +-
 exec.c          |  2 +-
 tcg/tcg.c       |  2 +-
 translate-all.c |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index e39ccb7..16898d3 100644
--- a/cpus.c
+++ b/cpus.c
@@ -159,7 +159,7 @@  int64_t cpu_get_icount_raw(void)
     if (cpu) {
         if (!cpu->can_do_io) {
             fprintf(stderr, "Bad icount read\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         icount -= (cpu->icount_decr.u16.low + cpu->icount_extra);
     }
@@ -829,7 +829,7 @@  static void qemu_kvm_eat_signals(CPUState *cpu)
         r = sigtimedwait(&waitset, &siginfo, &ts);
         if (r == -1 && !(errno == EAGAIN || errno == EINTR)) {
             perror("sigtimedwait");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
 
         switch (r) {
@@ -845,7 +845,7 @@  static void qemu_kvm_eat_signals(CPUState *cpu)
         r = sigpending(&chkset);
         if (r == -1) {
             perror("sigpending");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     } while (sigismember(&chkset, SIG_IPI) || sigismember(&chkset, SIGBUS));
 }
@@ -882,7 +882,7 @@  static void qemu_kvm_init_cpu_signals(CPUState *cpu)
     r = kvm_set_signal_mask(cpu, &set);
     if (r) {
         fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -1070,7 +1070,7 @@  static void *qemu_kvm_cpu_thread_fn(void *arg)
     r = kvm_init_vcpu(cpu);
     if (r < 0) {
         fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     qemu_kvm_init_cpu_signals(cpu);
@@ -1100,7 +1100,7 @@  static void *qemu_dummy_cpu_thread_fn(void *arg)
 {
 #ifdef _WIN32
     fprintf(stderr, "qtest is not supported under Windows\n");
-    exit(1);
+    exit(EXIT_FAILURE);
 #else
     CPUState *cpu = arg;
     sigset_t waitset;
@@ -1130,7 +1130,7 @@  static void *qemu_dummy_cpu_thread_fn(void *arg)
         } while (r == -1 && (errno == EAGAIN || errno == EINTR));
         if (r == -1) {
             perror("sigwait");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         qemu_mutex_lock_iothread();
         current_cpu = cpu;
@@ -1213,7 +1213,7 @@  static void qemu_cpu_kick_thread(CPUState *cpu)
     err = pthread_kill(cpu->thread->thread, SIG_IPI);
     if (err) {
         fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 #else /* _WIN32 */
     abort();
diff --git a/cputlb.c b/cputlb.c
index d068ee5..39cc513 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -491,7 +491,7 @@  tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr)
             cc->do_unassigned_access(cpu, addr, false, true, 0, 4);
         } else {
             report_bad_exec(cpu, addr);
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     }
     p = (void *)((uintptr_t)addr + env1->tlb_table[mmu_idx][page_index].addend);
diff --git a/exec.c b/exec.c
index c81d5ab..f62a54c 100644
--- a/exec.c
+++ b/exec.c
@@ -1801,7 +1801,7 @@  void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
                     fprintf(stderr, "Could not remap addr: "
                             RAM_ADDR_FMT "@" RAM_ADDR_FMT "\n",
                             length, addr);
-                    exit(1);
+                    exit(EXIT_FAILURE);
                 }
                 memory_try_enable_merging(vaddr, length);
                 qemu_ram_setup_dump(vaddr, length);
diff --git a/tcg/tcg.c b/tcg/tcg.c
index c450c62..0094fa5 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1269,7 +1269,7 @@  void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs)
                         if (target_parse_constraint(&def->args_ct[i], &ct_str) < 0) {
                             fprintf(stderr, "Invalid constraint '%s' for arg %d of operation '%s'\n",
                                     ct_str, i, def->name);
-                            exit(1);
+                            exit(EXIT_FAILURE);
                         }
                     }
                 }
diff --git a/translate-all.c b/translate-all.c
index b6663dc..5f1be0f 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -720,7 +720,7 @@  static inline void code_gen_alloc(size_t tb_size)
     tcg_ctx.code_gen_buffer = alloc_code_gen_buffer();
     if (tcg_ctx.code_gen_buffer == NULL) {
         fprintf(stderr, "Could not allocate dynamic translator buffer\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     /* Estimate a good size for the number of TBs we can support.  We