Set O_CLOEXEC on the remaining FDs that are created by eventcore.

This commit is contained in:
Sönke Ludwig 2017-12-19 18:44:22 +01:00
parent 324338205b
commit 6e2938297b
4 changed files with 13 additions and 8 deletions

View file

@ -34,7 +34,7 @@ final class InotifyEventDriverWatchers(Events : EventDriverEvents) : EventDriver
import std.range.primitives : walkLength;
enum IN_NONBLOCK = 0x800; // value in core.sys.linux.sys.inotify is incorrect
auto handle = () @trusted { return inotify_init1(IN_NONBLOCK); } ();
auto handle = () @trusted { return inotify_init1(IN_NONBLOCK | IN_CLOEXEC); } ();
if (handle == -1) return WatcherID.invalid;
auto ret = WatcherID(handle);