From: Simon McVittie Date: Tue, 23 Sep 2014 18:25:31 +0000 (+0100) Subject: inotify: make sure we set the close-on-exec flag X-Git-Tag: dbus-1.9.0~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=529691794ee370ca30848bb853321d0a26693ef6;p=thirdparty%2Fdbus.git 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 which is now required for _dbus_fd_set_close_on_exec -smcv] --- diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c index 49ebc721b..ce19fdc8b 100644 --- a/bus/dir-watch-inotify.c +++ b/bus/dir-watch-inotify.c @@ -38,6 +38,7 @@ #include #include +#include #include #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);