]> Sergey Matveev's repositories - nnn.git/commitdiff
don't leak inotify_fd to plugins
authorNRK <nrk@disroot.org>
Tue, 15 Feb 2022 13:02:21 +0000 (19:02 +0600)
committerNRK <nrk@disroot.org>
Tue, 15 Feb 2022 13:05:58 +0000 (19:05 +0600)
Closes: https://github.com/jarun/nnn/issues/1291
Co-authored-by: Daniel Eklöf <daniel@ekloef.se>
src/nnn.c

index 4977ff083616b570f42763c35fa5a094d5d9fbd2..6dc3bdf745904a31029ae17dd8cb6cb18d6f6998 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -8632,7 +8632,7 @@ int main(int argc, char *argv[])
 
 #ifdef LINUX_INOTIFY
        /* Initialize inotify */
-       inotify_fd = inotify_init1(IN_NONBLOCK);
+       inotify_fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
        if (inotify_fd < 0) {
                xerror();
                return EXIT_FAILURE;