From 6a2a0969f3665ee026b1c829a5891addd2e81222 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Thu, 14 Aug 2014 07:30:33 +0200 Subject: [PATCH] Set close-on-exec flag on inotify file descriptor --- src/monitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monitor.cpp b/src/monitor.cpp index 29f5ed3..0a31e2d 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -33,7 +33,7 @@ int Monitor::run(void) DEBUG("Starting inotify thread for path %s...\n", path.c_str()); - fd = inotify_init(); + fd = inotify_init1(IN_CLOEXEC); if (fd < 0) { ERROR("Unable to start inotify\n"); return fd;