qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 24/26] error, trace: use exit(EXIT_SUCCESS) and exit


From: Laurent Vivier
Subject: [Qemu-devel] [PATCH 24/26] error, trace: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 15:56:15 +0200

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

Signed-off-by: Laurent Vivier <address@hidden>
CC: Markus Armbruster <address@hidden>
---
 trace/control.c | 10 +++++-----
 util/error.c    |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/trace/control.c b/trace/control.c
index 05d85ac..b09d6f1 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -165,7 +165,7 @@ void trace_enable_events(const char *line_buf)
     if (is_help_option(line_buf)) {
         trace_list_events();
         if (cur_mon == NULL) {
-            exit(0);
+            exit(EXIT_SUCCESS);
         }
     } else {
         do_trace_enable_events(line_buf);
@@ -188,7 +188,7 @@ static void trace_init_events(const char *fname)
     fp = fopen(fname, "r");
     if (!fp) {
         error_report("%s", strerror(errno));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     while (fgets(line_buf, sizeof(line_buf), fp)) {
         loc_set_file(fname, ++line_idx);
@@ -204,7 +204,7 @@ static void trace_init_events(const char *fname)
     if (fclose(fp) != 0) {
         loc_set_file(fname, 0);
         error_report("%s", strerror(errno));
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     loc_pop(&loc);
 }
@@ -224,7 +224,7 @@ void trace_init_file(const char *file)
     if (file) {
         fprintf(stderr, "error: -trace file=...: "
                 "option not supported by the selected tracing backends\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 #endif
 }
@@ -258,7 +258,7 @@ char *trace_opt_parse(const char *optarg)
     QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("trace"),
                                              optarg, true);
     if (!opts) {
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     if (qemu_opt_get(opts, "enable")) {
         trace_enable_events(qemu_opt_get(opts, "enable"));
diff --git a/util/error.c b/util/error.c
index 9c40b1f..89b6e25 100644
--- a/util/error.c
+++ b/util/error.c
@@ -39,7 +39,7 @@ static void error_handle_fatal(Error **errp, Error *err)
     }
     if (errp == &error_fatal) {
         error_report_err(err);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 }
 
-- 
2.5.5




reply via email to

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