aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-08-06 01:30:56 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-08-06 01:30:56 +0530
commit75c34d5f68efedd3cccc1712a56bb3276c90b708 (patch)
tree55806465fb5488cb870c5d15046295f4ff288145 /src
parent5e3a79348096fc8781472f2accd1f37fc0eef577 (diff)
downloadnnn-75c34d5f68efedd3cccc1712a56bb3276c90b708.tar.gz
Fix #692 (partially)
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 6f434e1..0587edb 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -688,7 +688,7 @@ static uint fcolors[C_UND + 1] = {0};
/* Event handling */
#ifdef LINUX_INOTIFY
-#define NUM_EVENT_SLOTS 32 /* Make room for 8 events */
+#define NUM_EVENT_SLOTS 32 /* Make room for 32 events */
#define EVENT_SIZE (sizeof(struct inotify_event))
#define EVENT_BUF_LEN (EVENT_SIZE * NUM_EVENT_SLOTS)
static int inotify_fd, inotify_wd = -1;
@@ -2527,7 +2527,7 @@ static int nextsel(int presel)
for (char *ptr = inotify_buf;
ptr + ((struct inotify_event *)ptr)->len < inotify_buf + i;
ptr += sizeof(struct inotify_event) + event->len) {
- event = (struct inotify_event *) ptr;
+ event = (struct inotify_event *)ptr;
DPRINTF_D(event->wd);
DPRINTF_D(event->mask);
if (!event->wd)
@@ -5022,6 +5022,9 @@ static void populate(char *path, char *lastname)
#ifndef NOFIFO
static void notify_fifo(bool force)
{
+ if (!fifopath)
+ return;
+
if (fifofd == -1) {
fifofd = open(fifopath, O_WRONLY|O_NONBLOCK|O_CLOEXEC);
if (fifofd == -1) {
@@ -5081,8 +5084,7 @@ static void move_cursor(int target, int ignore_scrolloff)
curscroll = MAX(curscroll, MAX(cur - (onscreen - 1), 0));
#ifndef NOFIFO
- if (fifopath)
- notify_fifo(FALSE);
+ notify_fifo(FALSE);
#endif
}