qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: qemu-trivial@nongnu.org
Cc: qemu-devel@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-trivial] [PATCH 06/26] graphics: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 15:55:57 +0200	[thread overview]
Message-ID: <1474034177-17663-7-git-send-email-lvivier@redhat.com> (raw)
In-Reply-To: <1474034177-17663-1-git-send-email-lvivier@redhat.com>

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

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/console-gl.c |  2 +-
 ui/console.c    |  2 +-
 ui/curses.c     |  4 ++--
 ui/gtk.c        |  2 +-
 ui/sdl.c        |  8 ++++----
 ui/sdl2.c       |  2 +-
 ui/spice-core.c | 22 +++++++++++-----------
 ui/vnc.c        |  4 ++--
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/ui/console-gl.c b/ui/console-gl.c
index 5165e21..42627fb 100644
--- a/ui/console-gl.c
+++ b/ui/console-gl.c
@@ -46,7 +46,7 @@ ConsoleGLState *console_gl_init_context(void)
     gls->texture_blit_prog = qemu_gl_create_compile_link_program
         (texture_blit_vert_src, texture_blit_frag_src);
     if (!gls->texture_blit_prog) {
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     gls->texture_blit_vao =
diff --git a/ui/console.c b/ui/console.c
index 3940762..bef0678 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1389,7 +1389,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
         if (dcl->con->gl) {
             fprintf(stderr, "can't register two opengl displays (%s, %s)\n",
                     dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         dcl->con->gl = dcl;
     }
diff --git a/ui/curses.c b/ui/curses.c
index d06f724..ea5834d 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -408,7 +408,7 @@ static void curses_keyboard_setup(void)
     if(keyboard_layout) {
         kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
         if (!kbd_layout)
-            exit(1);
+            exit(EXIT_FAILURE);
     }
 }
 
@@ -425,7 +425,7 @@ void curses_display_init(DisplayState *ds, int full_screen)
 #ifndef _WIN32
     if (!isatty(1)) {
         fprintf(stderr, "We need a terminal output\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 #endif
 
diff --git a/ui/gtk.c b/ui/gtk.c
index 58d20ee..39d456a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2158,7 +2158,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
 
     if (!gtkinit) {
         fprintf(stderr, "gtk initialization failed\n");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
 
     s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
diff --git a/ui/sdl.c b/ui/sdl.c
index d8cf5bc..d2d67aa 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -92,7 +92,7 @@ static void sdl_update(DisplayChangeListener *dcl,
         } else {
             if (sdl_zoom_blit(guest_screen, real_screen, SMOOTHING_ON, &rec) < 0) {
                 fprintf(stderr, "Zoom blit failed\n");
-                exit(1);
+                exit(EXIT_FAILURE);
             }
         }
     } 
@@ -122,7 +122,7 @@ static void do_sdl_resize(int width, int height, int bpp)
         if (!tmp_screen) {
             fprintf(stderr, "Could not open SDL display (%dx%dx%d): %s\n",
                     width, height, bpp, SDL_GetError());
-            exit(1);
+            exit(EXIT_FAILURE);
         }
     } else {
         /*
@@ -957,7 +957,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     if(keyboard_layout) {
         kbd_layout = init_keyboard_layout(name2keysym, keyboard_layout);
         if (!kbd_layout)
-            exit(1);
+            exit(EXIT_FAILURE);
     }
 
     if (no_frame)
@@ -987,7 +987,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     if (SDL_Init (flags)) {
         fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
                 SDL_GetError());
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     vi = SDL_GetVideoInfo();
     host_format = *(vi->vfmt);
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 30d2a3c..73891aa 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -783,7 +783,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     if (SDL_Init(flags)) {
         fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
                 SDL_GetError());
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index da05054..859cba6 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -333,7 +333,7 @@ static int parse_name(const char *string, const char *optname,
         return value;
     }
     error_report("spice: invalid %s: %s", optname, string);
-    exit(1);
+    exit(EXIT_FAILURE);
 }
 
 static const char *stream_video_names[] = {
@@ -605,7 +605,7 @@ static int add_channel(void *opaque, const char *name, const char *value,
         if (!*tls_port) {
             error_report("spice: tried to setup tls-channel"
                          " without specifying a TLS port");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         security = SPICE_CHANNEL_SECURITY_SSL;
     }
@@ -622,7 +622,7 @@ static int add_channel(void *opaque, const char *name, const char *value,
     }
     if (rc != 0) {
         error_report("spice: failed to set channel security for %s", value);
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     return 0;
 }
@@ -661,11 +661,11 @@ void qemu_spice_init(void)
     tls_port = qemu_opt_get_number(opts, "tls-port", 0);
     if (port < 0 || port > 65535) {
         error_report("spice port is out of range");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     if (tls_port < 0 || tls_port > 65535) {
         error_report("spice tls-port is out of range");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     password = qemu_opt_get(opts, "password");
 
@@ -736,7 +736,7 @@ void qemu_spice_init(void)
     if (qemu_opt_get_bool(opts, "sasl", 0)) {
         if (spice_server_set_sasl(spice_server, 1) == -1) {
             error_report("spice: failed to enable sasl");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         auth = "sasl";
     }
@@ -755,7 +755,7 @@ void qemu_spice_init(void)
 #else
         error_report("this qemu build does not support the "
                      "\"disable-agent-file-xfer\" option");
-        exit(1);
+        exit(EXIT_FAILURE);
 #endif
     }
 
@@ -803,7 +803,7 @@ void qemu_spice_init(void)
     spice_server_set_sasl_appname(spice_server, "qemu");
     if (spice_server_init(spice_server, &core_interface) != 0) {
         error_report("failed to initialize spice server");
-        exit(1);
+        exit(EXIT_FAILURE);
     };
     using_spice = 1;
 
@@ -831,11 +831,11 @@ void qemu_spice_init(void)
         if ((port != 0) || (tls_port != 0)) {
             error_report("SPICE GL support is local-only for now and "
                          "incompatible with -spice port/tls-port");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         if (egl_rendernode_init() != 0) {
             error_report("Failed to initialize EGL render node for SPICE GL");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         display_opengl = 1;
     }
@@ -847,7 +847,7 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin)
     if (!spice_server) {
         if (QTAILQ_FIRST(&qemu_spice_opts.head) != NULL) {
             error_report("Oops: spice configured but not active");
-            exit(1);
+            exit(EXIT_FAILURE);
         }
         /*
          * Create a spice server instance.
diff --git a/ui/vnc.c b/ui/vnc.c
index 76a3273..796d857 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3154,7 +3154,7 @@ void vnc_display_init(const char *id)
     }
 
     if (!vs->kbd_layout)
-        exit(1);
+        exit(EXIT_FAILURE);
 
     vs->share_policy = VNC_SHARE_POLICY_ALLOW_EXCLUSIVE;
     vs->connections_limit = 32;
@@ -3929,7 +3929,7 @@ int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp)
     vnc_display_open(id, &local_err);
     if (local_err != NULL) {
         error_reportf_err(local_err, "Failed to start VNC server: ");
-        exit(1);
+        exit(EXIT_FAILURE);
     }
     return 0;
 }
-- 
2.5.5



  parent reply	other threads:[~2016-09-16 13:58 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 13:55 [Qemu-trivial] [PATCH 00/26] trivial: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE) Laurent Vivier
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 01/26] coccinelle: " Laurent Vivier
2016-09-16 15:35   ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 02/26] arm: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 03/26] cris: " Laurent Vivier
2016-09-16 14:41   ` Edgar E. Iglesias
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 04/26] block: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 05/26] ppc: " Laurent Vivier
2016-09-19  5:22   ` David Gibson
2016-09-16 13:55 ` Laurent Vivier [this message]
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 07/26] tests: " Laurent Vivier
2016-09-16 13:55 ` [Qemu-trivial] [PATCH 08/26] replay: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 09/26] qemu-user: " Laurent Vivier
2016-09-21 19:21   ` Riku Voipio
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 10/26] m68k: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 11/26] pci, virtio: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 12/26] sparc: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 13/26] sh4: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 14/26] x86: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 15/26] mips: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 16/26] s390: " Laurent Vivier
2016-09-19 11:07   ` Cornelia Huck
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 17/26] tcg: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 18/26] posix: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 19/26] alpha: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 20/26] common: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 21/26] misc machine: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 22/26] blockdev: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 23/26] core: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 24/26] error, trace: " Laurent Vivier
2016-09-16 15:55   ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 25/26] hw: " Laurent Vivier
2016-09-16 13:56 ` [Qemu-trivial] [PATCH 26/26] net: " Laurent Vivier
2016-09-16 14:41 ` [Qemu-trivial] [Qemu-devel] [PATCH 00/26] trivial: " no-reply
2016-09-16 14:47 ` Peter Maydell
2016-09-16 15:39   ` Daniel P. Berrange
2016-09-16 15:45     ` Peter Maydell
2016-09-19  9:21       ` Markus Armbruster
2016-09-19  9:46       ` Laurent Vivier
2016-09-19 10:19         ` Peter Maydell
2016-09-19 10:32       ` Cornelia Huck
2016-09-16 15:27 ` Daniel P. Berrange
2016-09-16 15:39   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474034177-17663-7-git-send-email-lvivier@redhat.com \
    --to=lvivier@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).