aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-19 20:13:03 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-19 20:13:03 +0530
commitac2a4041b691a1afd03db4b2204df0abbe24f515 (patch)
tree1cc3171eaec50c3b66f541b783bfb4001e59ce29
parent24b72f65c58e4a09d9b43230d8ad661536a59eb6 (diff)
downloadnnn-ac2a4041b691a1afd03db4b2204df0abbe24f515.tar.gz
Fix build break
-rw-r--r--src/nnn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nnn.c b/src/nnn.c
index b374306..8ffcee9 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1416,6 +1416,7 @@ static int nextsel(int presel)
uint i;
const uint len = LEN(bindings);
#ifdef LINUX_INOTIFY
+ char *ptr;
struct inotify_event *event;
static char inotify_buf[EVENT_BUF_LEN]
__attribute__ ((aligned(__alignof__(struct inotify_event))));
@@ -1446,9 +1447,9 @@ static int nextsel(int presel)
*/
#ifdef LINUX_INOTIFY
if (!cfg.blkorder && inotify_wd >= 0 && (idle & 1)) {
- ssize_t bytes = read(inotify_fd, inotify_buf, EVENT_BUF_LEN);
- if (bytes > 0) {
- for (char *ptr = inotify_buf; ptr < inotify_buf + bytes;
+ i = read(inotify_fd, inotify_buf, EVENT_BUF_LEN);
+ if (i > 0) {
+ for (ptr = inotify_buf; ptr < inotify_buf + i;
ptr += sizeof(struct inotify_event) + event->len) {
event = (struct inotify_event *) ptr;
DPRINTF_D(event->wd);