summaryrefslogtreecommitdiffstats
path: root/src/bfstd.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-10-31 13:25:04 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-10-31 13:25:30 -0400
commit8aaf670c13ade259f7bcdd50332968c1c6290b34 (patch)
tree8794f55c7777f560c37ebcebb78a4a6be30d92f1 /src/bfstd.c
parent06ee53d5b1fc58073aaa3d57f6073256d13502f2 (diff)
downloadbfs-8aaf670c13ade259f7bcdd50332968c1c6290b34.tar.xz
bfstd: New xwaitpid() wrapper
Diffstat (limited to 'src/bfstd.c')
-rw-r--r--src/bfstd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bfstd.c b/src/bfstd.c
index eee02b8..06226a2 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <unistd.h>
#include <wchar.h>
#include <wctype.h>
@@ -391,6 +392,14 @@ int xminor(dev_t dev) {
#endif
}
+pid_t xwaitpid(pid_t pid, int *status, int flags) {
+ pid_t ret;
+ do {
+ ret = waitpid(pid, status, flags);
+ } while (ret < 0 && errno == EINTR);
+ return ret;
+}
+
int dup_cloexec(int fd) {
#ifdef F_DUPFD_CLOEXEC
return fcntl(fd, F_DUPFD_CLOEXEC, 0);