From b0960a2e3d89f680eb5a0bc46379309d3a1eae05 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Wed, 20 Mar 2019 05:50:20 +0530 Subject: Break when watch desc becomes 0 --- src/nnn.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nnn.c') diff --git a/src/nnn.c b/src/nnn.c index 4e13770..88656ad 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1454,11 +1454,16 @@ static int nextsel(int presel) event = (struct inotify_event *) ptr; DPRINTF_D(event->wd); DPRINTF_D(event->mask); + if (!event->wd) + break; + if (event->mask & INOTIFY_MASK) { c = CONTROL('L'); + DPRINTF_S("issue refresh"); break; } } + DPRINTF_S("inotify read done"); } } #elif defined(BSD_KQUEUE) -- cgit v1.2.3-70-g09d2