浏览代码

Disable dir watch in filter mode

master
Arun Prakash Jana 8 年前
父节点
当前提交
be337d883e
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 21 次插入7 次删除
  1. +21
    -7
      nnn.c

+ 21
- 7
nnn.c 查看文件

@@ -785,21 +785,35 @@ nextsel(char **run, char **env, int *presel)


if (c == 0) if (c == 0)
c = getch(); c = getch();
else
else {
*presel = 0; *presel = 0;


/* Unwatch dir if we are still in a filtered view */
#ifdef LINUX_INOTIFY
if (inotify_wd >= 0) {
inotify_rm_watch(inotify_fd, inotify_wd);
inotify_wd = -1;
}
#elif defined(BSD_KQUEUE)
if (event_fd >= 0) {
close(event_fd);
event_fd = -1;
}
#endif
}

if (c == -1) { if (c == -1) {
++idle; ++idle;
#ifdef LINUX_INOTIFY
/* Do not check for directory changes in du /* Do not check for directory changes in du
* mode. A redraw forces du calculation. * mode. A redraw forces du calculation.
* Check for changes every odd second. * Check for changes every odd second.
*/ */
if (!cfg.blkorder && inotify_wd >= 0 && idle & 1)
if (read(inotify_fd, inotify_buf, EVENT_BUF_LEN) > 0)
#ifdef LINUX_INOTIFY
if (!cfg.blkorder && inotify_wd >= 0 && idle & 1 && read(inotify_fd, inotify_buf, EVENT_BUF_LEN) > 0)
#elif defined(BSD_KQUEUE) #elif defined(BSD_KQUEUE)
if (!cfg.blkorder && event_fd >= 0 && idle & 1)
if (kevent(kq, events_to_monitor, NUM_EVENT_SLOTS, event_data, NUM_EVENT_FDS, &gtimeout) > 0)
if (!cfg.blkorder && event_fd >= 0 && idle & 1
&& kevent(kq, events_to_monitor, NUM_EVENT_SLOTS, event_data, NUM_EVENT_FDS, &gtimeout) > 0)
#endif #endif
c = CONTROL('L'); c = CONTROL('L');
} else } else
@@ -2492,7 +2506,7 @@ nochange:
break; break;


/* Open the descriptor to currently open directory */ /* Open the descriptor to currently open directory */
fd = open(path, O_RDONLY | O_DIRECTORY | O_NOATIME);
fd = open(path, O_RDONLY | O_DIRECTORY);
if (fd == -1) { if (fd == -1) {
printwarn(); printwarn();
goto nochange; goto nochange;


正在加载...
取消
保存