From 9eb16aa2cdcdf14642ef43e5498a8f626a72d99c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 17 Oct 2017 18:24:03 +0200 Subject: Rewrite and relicense MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- reapd.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 reapd.c (limited to 'reapd.c') diff --git a/reapd.c b/reapd.c new file mode 100644 index 0000000..c3ba452 --- /dev/null +++ b/reapd.c @@ -0,0 +1,27 @@ +/* See LICENSE file for copyright and license details. */ +#include +#include +#include +#include +#include + + +int +main(int argc, char *argv[]) +{ + for (;;) { + if (wait(NULL) == -1) { + if (errno == ECHILD) + return 0; + if (errno == EINTR) + continue; + fprintf(stderr, "%s: wait: %s\n", *argv, strerror(errno)); + return 2; + } +#ifdef TEST + printf("reaped\n"); +#endif + } + + (void) argc; +} -- cgit v1.2.3-70-g09d2