From 249866e3d1e11dc72eaa1305f4bb479ded92ef38 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 13:58:20 +0200 Subject: reorganized file structure Moved c files into src/. Corrected VERSION file. Removed BUILD and FILES. --- src/wait.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/wait.c (limited to 'src/wait.c') diff --git a/src/wait.c b/src/wait.c new file mode 100644 index 0000000..869a120 --- /dev/null +++ b/src/wait.c @@ -0,0 +1,25 @@ +#include +#include +#include "logmsg.h" + +/** + @file wait.c + @author djb + @source qmail + @brief wait for forked processes +*/ + +int wait_nohang(int *wstat) +{ + return waitpid(-1,wstat,WNOHANG); +} + +int wait_pid(int *wstat,int pid) +{ + int r; + + do + r = waitpid(pid,wstat,0); + while ((r == -1) && (errno == EINTR)); + return r; +} -- cgit v1.2.3