Skip to content

Commit

Permalink
inotify_init1(IN_CLOEXEC) (#3550)
Browse files Browse the repository at this point in the history
As
[mentioned](#3544 (comment))
by @RAOF, we don't want the FD leaking to child processes
  • Loading branch information
Saviq authored Aug 14, 2024
2 parents 210d4c4 + 1ce7b6d commit 6344c95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/miral/static_display_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ auto miral::ReloadingYamlFileDisplayConfig::inotify_config_path() -> std::option

if (!config_path_) return std::nullopt;

mir::Fd inotify_fd{inotify_init()};
mir::Fd inotify_fd{inotify_init1(IN_CLOEXEC)};

if (inotify_fd < 0)
BOOST_THROW_EXCEPTION((std::system_error{errno, std::system_category(), "Failed to initialize inotify_fd"}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void mf::ForeignSurfaceObserver::application_id_set_to(
// GDesktopFileCache
mf::GDesktopFileCache::GDesktopFileCache(const std::shared_ptr<MainLoop> &main_loop)
: main_loop{main_loop},
inotify_fd{inotify_init()}
inotify_fd{inotify_init1(IN_CLOEXEC)}
{
refresh_app_cache();

Expand Down

0 comments on commit 6344c95

Please sign in to comment.