Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

This commit is contained in:
Eli Zaretskii 2024-06-23 07:57:22 +03:00
commit dd0994aa36
2 changed files with 44 additions and 35 deletions

View file

@ -4129,7 +4129,9 @@ case $with_file_notification,$NOTIFY_OBJ in
fi ;;
esac
dnl kqueue is available on BSD-like systems.
AS_IF([test "$opsys" != "haiku"], [
dnl kqueue is available on BSD-like systems and Haiku, but Haiku's
dnl implementation cannot monitor filesystem activity.
case $with_file_notification,$NOTIFY_OBJ in
kqueue,* | yes,)
EMACS_CHECK_MODULES([KQUEUE], [libkqueue])
@ -4148,7 +4150,7 @@ case $with_file_notification,$NOTIFY_OBJ in
NOTIFY_SUMMARY="yes (kqueue)"
fi
fi ;;
esac
esac])
dnl g_file_monitor exists since glib 2.18. G_FILE_MONITOR_EVENT_MOVED
dnl has been added in glib 2.24. It has been tested under

View file

@ -444,10 +444,15 @@ only when the upper directory of the renamed file is watched. */)
if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE;
/* 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);
if (kevent (kqueuefd, &kev, 1, NULL, 0, NULL) < 0) {
if (kevent (kqueuefd, &kev, 1, NULL, 0, NULL) < 0)
{
emacs_close (fd);
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);
if (NILP (Ffile_directory_p (file)))
watch_object = list4 (watch_descriptor, file, flags, callback);
else {
else
{
dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil,
Qnil);
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. */
watch_list = Fdelq (watch_object, watch_list);
if (NILP (watch_list) && (kqueuefd >= 0)) {
if (NILP (watch_list) && (kqueuefd >= 0))
{
delete_read_fd (kqueuefd);
emacs_close (kqueuefd);
kqueuefd = -1;