From 78838ed9309d22ab25b5293631c948cb9bb2fa54 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 28 Feb 2018 19:26:43 -0500 Subject: Open watch files O_CLOEXEC Thankfully kqueue is CLOEXEC by default it seems. --- bin/watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/watch.c b/bin/watch.c index a18d9b36..442835fa 100644 --- a/bin/watch.c +++ b/bin/watch.c @@ -25,7 +25,7 @@ #include static void watch(int kq, char *path) { - int fd = open(path, O_RDONLY); + int fd = open(path, O_CLOEXEC); if (fd < 0) err(EX_NOINPUT, "%s", path); struct kevent event = { -- cgit 1.4.1