diff mbox

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

Message ID 1474034177-17663-27-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: Jason Wang <jasowang@redhat.com>
---
 net/net.c    | 4 ++--
 slirp/misc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/net/net.c b/net/net.c
index d51cb29..0215618 100644
--- a/net/net.c
+++ b/net/net.c
@@ -840,9 +840,9 @@  void qemu_check_nic_model(NICInfo *nd, const char *model)
     models[1] = NULL;
 
     if (qemu_show_nic_models(nd->model, models))
-        exit(0);
+        exit(EXIT_SUCCESS);
     if (qemu_find_nic_model(nd, models, model) < 0)
-        exit(1);
+        exit(EXIT_FAILURE);
 }
 
 int qemu_find_nic_model(NICInfo *nd, const char * const *models,
diff --git a/slirp/misc.c b/slirp/misc.c
index 88e9d94..9ceb822 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -172,7 +172,7 @@  fork_exec(struct socket *so, const char *ex, int do_pty)
         fprintf(stderr, "Error: execvp of %s failed: %s\n",
                 argv[0], strerror(errno));
 		close(0); close(1); close(2); /* XXX */
-		exit(1);
+                exit(EXIT_FAILURE);
 
 	 default:
 		qemu_add_child_watch(pid);