aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Vlad Glagolev <vaygr@users.noreply.github.com>2017-10-07 21:42:12 -0400
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-10-08 07:12:12 +0530
commitcaf368f593ef2f461dba6c0f22abdb1726e019e6 (patch)
treeb607ad5dcf87a2188262ef65dfbbf39fb7fd3c54
parent935fca41f1e0e7fcbcf023f0520b7768e4ad206d (diff)
downloadnnn-caf368f593ef2f461dba6c0f22abdb1726e019e6.tar.gz
OpenBSD compatibility support (#48)
* Improve compatibility with OpenBSD * Fix indefinite blocking
-rw-r--r--nnn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nnn.c b/nnn.c
index 65c8ff3..1b46491 100644
--- a/nnn.c
+++ b/nnn.c
@@ -2122,7 +2122,11 @@ begin:
inotify_wd = inotify_add_watch(inotify_fd, path, INOTIFY_MASK);
#elif defined(BSD_KQUEUE)
if (event_fd == -1) {
+#if defined(O_EVTONLY)
event_fd = open(path, O_EVTONLY);
+#else
+ event_fd = open(path, O_RDONLY);
+#endif
if (event_fd >= 0)
EV_SET(&events_to_monitor[0], event_fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, KQUEUE_FFLAGS, 0, path);
}
@@ -2889,7 +2893,7 @@ main(int argc, char *argv[])
}
gtimeout.tv_sec = 0;
- gtimeout.tv_nsec = 50; /* 50 ns delay */
+ gtimeout.tv_nsec = 0;
#endif
/* Parse bookmarks string, if available */