mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-22 06:50:36 +01:00
Bug 22516 - Ensure inotify fd is set close on exec
This prevents it leaking into spawned child processes. Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
parent
98bbe8c794
commit
f4e15893e5
2 changed files with 5 additions and 1 deletions
|
|
@ -98,7 +98,11 @@ bus_watch_directory (const char *dir, BusContext *context)
|
|||
_dbus_assert (dir != NULL);
|
||||
|
||||
if (inotify_fd == -1) {
|
||||
#ifdef HAVE_INOTIFY_INIT1
|
||||
inotify_fd = inotify_init1 (IN_CLOEXEC);
|
||||
#else
|
||||
inotify_fd = inotify_init ();
|
||||
#endif
|
||||
if (inotify_fd <= 0) {
|
||||
_dbus_warn ("Cannot initialize inotify\n");
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -754,7 +754,7 @@ fi
|
|||
dnl check if inotify backend is enabled
|
||||
if test x$have_inotify = xyes; then
|
||||
AC_DEFINE(DBUS_BUS_ENABLE_INOTIFY,1,[Use inotify])
|
||||
|
||||
AC_CHECK_FUNCS(inotify_init1)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue