summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-28 19:26:43 -0500
committerJune McEnroe <june@causal.agency>2018-02-28 19:26:43 -0500
commit78838ed9309d22ab25b5293631c948cb9bb2fa54 (patch)
treee5c58a0a53d33f39318e51a3747d99469b420ca9
parentClean up pngo (diff)
downloadsrc-78838ed9309d22ab25b5293631c948cb9bb2fa54.tar.gz
src-78838ed9309d22ab25b5293631c948cb9bb2fa54.zip
Open watch files O_CLOEXEC
Thankfully kqueue is CLOEXEC by default it seems.
-rw-r--r--bin/watch.c2
1 files changed, 1 insertions, 1 deletions
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 <unistd.h>
 
 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 = {