From 799b8fd3782e55149bcfa9ec1c6d1002a7eb11da Mon Sep 17 00:00:00 2001 From: NRK Date: Tue, 15 Feb 2022 19:02:21 +0600 Subject: [PATCH] don't leak inotify_fd to plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://github.com/jarun/nnn/issues/1291 Co-authored-by: Daniel Eklöf --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 4977ff08..6dc3bdf7 100644 --- 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;