mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
OpenBSD compatibility support (#48)
* Improve compatibility with OpenBSD * Fix indefinite blocking
This commit is contained in:
parent
935fca41f1
commit
caf368f593
6
nnn.c
6
nnn.c
|
@ -2122,7 +2122,11 @@ begin:
|
||||||
inotify_wd = inotify_add_watch(inotify_fd, path, INOTIFY_MASK);
|
inotify_wd = inotify_add_watch(inotify_fd, path, INOTIFY_MASK);
|
||||||
#elif defined(BSD_KQUEUE)
|
#elif defined(BSD_KQUEUE)
|
||||||
if (event_fd == -1) {
|
if (event_fd == -1) {
|
||||||
|
#if defined(O_EVTONLY)
|
||||||
event_fd = open(path, O_EVTONLY);
|
event_fd = open(path, O_EVTONLY);
|
||||||
|
#else
|
||||||
|
event_fd = open(path, O_RDONLY);
|
||||||
|
#endif
|
||||||
if (event_fd >= 0)
|
if (event_fd >= 0)
|
||||||
EV_SET(&events_to_monitor[0], event_fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, KQUEUE_FFLAGS, 0, path);
|
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_sec = 0;
|
||||||
gtimeout.tv_nsec = 50; /* 50 ns delay */
|
gtimeout.tv_nsec = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Parse bookmarks string, if available */
|
/* Parse bookmarks string, if available */
|
||||||
|
|
Loading…
Reference in a new issue