summaryrefslogtreecommitdiff
path: root/bus/dir-watch-inotify.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-23 19:25:31 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-23 19:25:55 +0100
commit529691794ee370ca30848bb853321d0a26693ef6 (patch)
tree06f91f835c32fb30a2ac1d2891e45c4ac8cf10a4 /bus/dir-watch-inotify.c
parent96646adbe9678cbb69b8c314b3c4433d6207277b (diff)
downloaddbus-529691794ee370ca30848bb853321d0a26693ef6.tar.gz
inotify: make sure we set the close-on-exec flag
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73689 Reviewed-by: Ralf Habacker [add <dbus/dbus-sysdeps-unix.h> which is now required for _dbus_fd_set_close_on_exec -smcv]
Diffstat (limited to 'bus/dir-watch-inotify.c')
-rw-r--r--bus/dir-watch-inotify.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c
index 49ebc721..ce19fdc8 100644
--- a/bus/dir-watch-inotify.c
+++ b/bus/dir-watch-inotify.c
@@ -38,6 +38,7 @@
#include <dbus/dbus-internals.h>
#include <dbus/dbus-list.h>
+#include <dbus/dbus-sysdeps-unix.h>
#include <dbus/dbus-watch.h>
#include "dir-watch.h"
@@ -236,6 +237,11 @@ _init_inotify (BusContext *context)
_dbus_warn ("Cannot initialize inotify\n");
goto out;
}
+
+ /* In the inotify_init1 case this is unnecessary but harmless,
+ * in the other cases it's necessary */
+ _dbus_fd_set_close_on_exec (inotify_fd);
+
loop = bus_context_get_loop (context);
_dbus_loop_ref (loop);