exit(0) on success, non-zero if an error occurred or signal was received - catp… | |
git clone git://bitreich.org/catpoint/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrin… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit 4749f13de5cfd18a997135c10d5ea859e56efaba | |
parent 79fcfa10f48e539001da1288f7a084f07b895abf | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Sun, 20 Dec 2020 15:51:33 +0100 | |
exit(0) on success, non-zero if an error occurred or signal was received | |
Signed-off-by: Christoph Lohmann <[email protected]> | |
Diffstat: | |
M catpoint.c | 5 +++-- | |
1 file changed, 3 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/catpoint.c b/catpoint.c | |
@@ -14,7 +14,7 @@ | |
#include <locale.h> | |
char *currentslidep, **slidefiles; /* the slides */ | |
-int nslides, currentslide, currentslidelen; | |
+int nslides, currentslide, currentslidelen, exitstatus = 1; | |
void | |
unloadcurrentslide(void) | |
@@ -32,7 +32,7 @@ cleanup(int sig) | |
unloadcurrentslide(); | |
endwin(); /* restore terminal */ | |
- exit(1); | |
+ exit(exitstatus); | |
} | |
void | |
@@ -167,6 +167,7 @@ again: | |
} | |
/* unmap mem */ | |
+ exitstatus = 0; | |
cleanup(0); | |
return 0; |