mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 11:23:24 +00:00
Fix compilation on prerelease versions of Haiku
* src/kqueue.c (Fkqueue_add_watch): Don't specify EV_ENABLE unless it is defined.
This commit is contained in:
parent
2b848a4e50
commit
cb7be6035e
1 changed files with 22 additions and 15 deletions
15
src/kqueue.c
15
src/kqueue.c
|
@ -444,10 +444,15 @@ only when the upper directory of the renamed file is watched. */)
|
||||||
if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE;
|
if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE;
|
||||||
|
|
||||||
/* Register event. */
|
/* Register event. */
|
||||||
EV_SET (&kev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
|
EV_SET (&kev, fd, EVFILT_VNODE, (EV_ADD
|
||||||
|
#ifdef EV_ENABLE
|
||||||
|
| EV_ENABLE
|
||||||
|
#endif /* EV_ENABLE */
|
||||||
|
| EV_CLEAR),
|
||||||
fflags, 0, NULL);
|
fflags, 0, NULL);
|
||||||
|
|
||||||
if (kevent (kqueuefd, &kev, 1, NULL, 0, NULL) < 0) {
|
if (kevent (kqueuefd, &kev, 1, NULL, 0, NULL) < 0)
|
||||||
|
{
|
||||||
emacs_close (fd);
|
emacs_close (fd);
|
||||||
report_file_error ("Cannot watch file", file);
|
report_file_error ("Cannot watch file", file);
|
||||||
}
|
}
|
||||||
|
@ -456,7 +461,8 @@ only when the upper directory of the renamed file is watched. */)
|
||||||
Lisp_Object watch_descriptor = make_fixnum (fd);
|
Lisp_Object watch_descriptor = make_fixnum (fd);
|
||||||
if (NILP (Ffile_directory_p (file)))
|
if (NILP (Ffile_directory_p (file)))
|
||||||
watch_object = list4 (watch_descriptor, file, flags, callback);
|
watch_object = list4 (watch_descriptor, file, flags, callback);
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil,
|
dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil,
|
||||||
Qnil);
|
Qnil);
|
||||||
watch_object = list5 (watch_descriptor, file, flags, callback, dir_list);
|
watch_object = list5 (watch_descriptor, file, flags, callback, dir_list);
|
||||||
|
@ -486,7 +492,8 @@ WATCH-DESCRIPTOR should be an object returned by `kqueue-add-watch'. */)
|
||||||
/* Remove watch descriptor from watch list. */
|
/* Remove watch descriptor from watch list. */
|
||||||
watch_list = Fdelq (watch_object, watch_list);
|
watch_list = Fdelq (watch_object, watch_list);
|
||||||
|
|
||||||
if (NILP (watch_list) && (kqueuefd >= 0)) {
|
if (NILP (watch_list) && (kqueuefd >= 0))
|
||||||
|
{
|
||||||
delete_read_fd (kqueuefd);
|
delete_read_fd (kqueuefd);
|
||||||
emacs_close (kqueuefd);
|
emacs_close (kqueuefd);
|
||||||
kqueuefd = -1;
|
kqueuefd = -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue