Commit 52969179 authored by Simon McVittie's avatar Simon McVittie

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]
parent 96646adb
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <dbus/dbus-internals.h> #include <dbus/dbus-internals.h>
#include <dbus/dbus-list.h> #include <dbus/dbus-list.h>
#include <dbus/dbus-sysdeps-unix.h>
#include <dbus/dbus-watch.h> #include <dbus/dbus-watch.h>
#include "dir-watch.h" #include "dir-watch.h"
...@@ -236,6 +237,11 @@ _init_inotify (BusContext *context) ...@@ -236,6 +237,11 @@ _init_inotify (BusContext *context)
_dbus_warn ("Cannot initialize inotify\n"); _dbus_warn ("Cannot initialize inotify\n");
goto out; 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); loop = bus_context_get_loop (context);
_dbus_loop_ref (loop); _dbus_loop_ref (loop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment