aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-27 00:00:16 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-27 00:00:16 +0100
commit8e6b7c1a4cdcb282c99bd235149608d59c5080b2 (patch)
tree3b8c294bd6de1bd99db39231560235d8d5d89b64 /src
parentuse clut (diff)
downloadunstickpixels-8e6b7c1a4cdcb282c99bd235149608d59c5080b2.tar.gz
unstickpixels-8e6b7c1a4cdcb282c99bd235149608d59c5080b2.tar.bz2
unstickpixels-8e6b7c1a4cdcb282c99bd235149608d59c5080b2.tar.xz
exit with the same value as the child
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/unstickpixels.c6
1 files 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;
}