qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/26] replay: use exit(EXIT_SUCCESS) and exit(EXIT_


From: Laurent Vivier
Subject: [Qemu-devel] [PATCH 08/26] replay: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 15:55:59 +0200

This patch is the result of coccinelle script
scripts/coccinelle/exit.cocci

Signed-off-by: Laurent Vivier <address@hidden>
---
 replay/replay-char.c     |  6 +++---
 replay/replay-events.c   |  6 +++---
 replay/replay-internal.c |  2 +-
 replay/replay-time.c     |  2 +-
 replay/replay.c          | 14 +++++++-------
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/replay/replay-char.c b/replay/replay-char.c
index edf46ab..0011079 100755
--- a/replay/replay-char.c
+++ b/replay/replay-char.c
@@ -56,7 +56,7 @@ void replay_chr_be_write(CharDriverState *s, uint8_t *buf, 
int len)
     event->id = find_char_driver(s);
     if (event->id < 0) {
         fprintf(stderr, "Replay: cannot find char driver\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     event->buf = g_malloc(len);
     memcpy(event->buf, buf, len);
@@ -116,7 +116,7 @@ void replay_char_write_event_load(int *res, int *offset)
     } else {
         replay_mutex_unlock();
         error_report("Missing character write event in the replay log");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 }
 
@@ -140,7 +140,7 @@ int replay_char_read_all_load(uint8_t *buf)
     } else {
         replay_mutex_unlock();
         error_report("Missing character read all event in the replay log");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 }
 
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 3807245..14a2978 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -57,7 +57,7 @@ static void replay_run_event(Event *event)
     default:
         error_report("Replay: invalid async event ID (%d) in the queue",
                     event->event_kind);
-        exit(1);
+        exit(EXIT_FAILURE);
         break;
     }
 }
@@ -191,7 +191,7 @@ static void replay_save_event(Event *event, int checkpoint)
             break;
         default:
             error_report("Unknown ID %" PRId64 " of replay event", event->id);
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     }
 }
@@ -254,7 +254,7 @@ static Event *replay_read_event(int checkpoint)
         break;
     default:
         error_report("Unknown ID %d of replay event", read_event_kind);
-        exit(1);
+        exit(EXIT_FAILURE);
         break;
     }
 
diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 5835e8d..532323d 100644
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -159,7 +159,7 @@ void replay_fetch_data_kind(void)
             replay_has_unread_data = 1;
             if (replay_data_kind >= EVENT_COUNT) {
                 error_report("Replay: unknown event kind %d", 
replay_data_kind);
-                exit(1);
+                exit(EXIT_FAILURE);
             }
         }
     }
diff --git a/replay/replay-time.c b/replay/replay-time.c
index fffe072..1741a84 100644
--- a/replay/replay-time.c
+++ b/replay/replay-time.c
@@ -61,5 +61,5 @@ int64_t replay_read_clock(ReplayClockKind kind)
     }
 
     error_report("REPLAY INTERNAL ERROR %d", __LINE__);
-    exit(1);
+    exit(EXIT_FAILURE);
 }
diff --git a/replay/replay.c b/replay/replay.c
index 167fd29..d257b24 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -221,7 +221,7 @@ static void replay_enable(const char *fname, int mode)
         break;
     default:
         fprintf(stderr, "Replay: internal error: invalid replay mode\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     atexit(replay_finish);
@@ -231,7 +231,7 @@ static void replay_enable(const char *fname, int mode)
     replay_file = fopen(fname, fmode);
     if (replay_file == NULL) {
         fprintf(stderr, "Replay: open %s: %s\n", fname, strerror(errno));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     replay_filename = g_strdup(fname);
@@ -248,7 +248,7 @@ static void replay_enable(const char *fname, int mode)
         unsigned int version = replay_get_dword();
         if (version != REPLAY_VERSION) {
             fprintf(stderr, "Replay: invalid input log file version\n");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         /* go to the beginning */
         fseek(replay_file, HEADER_SIZE, SEEK_SET);
@@ -282,13 +282,13 @@ void replay_configure(QemuOpts *opts)
         mode = REPLAY_MODE_PLAY;
     } else {
         error_report("Invalid icount rr option: %s", rr);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     fname = qemu_opt_get(opts, "rrfile");
     if (!fname) {
         error_report("File name not specified for replay");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     replay_enable(fname, mode);
@@ -305,11 +305,11 @@ void replay_start(void)
 
     if (replay_blockers) {
         error_reportf_err(replay_blockers->data, "Record/replay: ");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     if (!use_icount) {
         error_report("Please enable icount to use record/replay");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     /* Timer for snapshotting will be set up here. */
-- 
2.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]