From 8e6b7c1a4cdcb282c99bd235149608d59c5080b2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 27 Dec 2015 00:00:16 +0100 Subject: exit with the same value as the child MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/unstickpixels.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unstickpixels.c b/src/unstickpixels.c index 0c75c78..aceb3a1 100644 --- a/src/unstickpixels.c +++ b/src/unstickpixels.c @@ -413,7 +413,7 @@ int main(int argc, char* argv[]) int started = 0; int with_sleep = 0; struct timespec interval; - int _status, vt = 0, c = 0; + int status, vt = 0, c = 0; pid_t pid = -1; int saved_errno; @@ -474,12 +474,12 @@ int main(int argc, char* argv[]) return 0; parent: - waitpid(pid, &_status, 0); + waitpid(pid, &status, 0); done: if (!vt) term_clut(); printf("%s\033[?25h\033[H\033[2J", (started && vt) ? "\033]P0000000" : ""); fflush(stdout); - return 0; /* TODO return 1 on failure */ + return WIFEXITED(status) ? WEXITSTATUS(status) : 0; } -- cgit v1.2.3-70-g09d2