From 3ba33321de0790d60dc473acee093de5a3650480 Mon Sep 17 00:00:00 2001 From: Christoph Gysin Date: Sat, 28 Nov 2015 15:47:44 +0200 Subject: [PATCH] Use macros for exit values --- sway/main.c | 6 +++--- swaybg/main.c | 2 +- swaygrab/main.c | 4 ++-- swaymsg/main.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sway/main.c b/sway/main.c index dd609214b..60a41923c 100644 --- a/sway/main.c +++ b/sway/main.c @@ -90,7 +90,7 @@ int main(int argc, char **argv) { #else fprintf(stdout, "version not detected\n"); #endif - exit(0); + exit(EXIT_SUCCESS); break; case 'V': // verbose verbose = 1; @@ -98,10 +98,10 @@ int main(int argc, char **argv) { case 'p': ; // --get-socketpath if (getenv("SWAYSOCK")) { fprintf(stdout, "%s\n", getenv("SWAYSOCK")); - exit(0); + exit(EXIT_SUCCESS); } else { fprintf(stderr, "sway socket not detected.\n"); - exit(1); + exit(EXIT_FAILURE); } break; } diff --git a/swaybg/main.c b/swaybg/main.c index ec64ddb71..69d718c51 100644 --- a/swaybg/main.c +++ b/swaybg/main.c @@ -29,7 +29,7 @@ void sway_terminate(void) { } list_free(surfaces); registry_teardown(registry); - exit(1); + exit(EXIT_FAILURE); } int main(int argc, const char **argv) { diff --git a/swaygrab/main.c b/swaygrab/main.c index 63cf223f4..e60d154fc 100644 --- a/swaygrab/main.c +++ b/swaygrab/main.c @@ -10,7 +10,7 @@ #include "ipc-client.h" void sway_terminate(void) { - exit(1); + exit(EXIT_FAILURE); } int numlen(int n) { @@ -163,7 +163,7 @@ int main(int argc, char **argv) { #else fprintf(stdout, "version not detected\n"); #endif - exit(0); + exit(EXIT_SUCCESS); break; } } diff --git a/swaymsg/main.c b/swaymsg/main.c index 3a2e1ee75..e629bcc2b 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -12,7 +12,7 @@ #include "log.h" void sway_terminate(void) { - exit(1); + exit(EXIT_FAILURE); } int main(int argc, char **argv) { @@ -52,7 +52,7 @@ int main(int argc, char **argv) { #else fprintf(stdout, "version not detected\n"); #endif - exit(0); + exit(EXIT_SUCCESS); break; } }