* src/inotify.c (inotifyevent_to_event): Always match events
that are not encompassed by IN_ALL_EVENTS and which the
documentation implies are always delivered to callbacks.
* test/src/inotify-tests.el (inotify-file-watch-stop-delivery):
New test.
(cherry picked from commit
928dc34e05fc04a9b8394df477beca2ef6d9fd1b)
uint32_t mask;
CONS_TO_INTEGER (Fnth (make_fixnum (3), watch), uint32_t, mask);
- if (! (mask & ev->mask))
+ if (! (mask & ev->mask)
+ /* These event types are supposed to be reported whether or not
+ they appeared in the ASPECT list when monitoring commenced. */
+ && !(ev->mask & (IN_IGNORED | IN_Q_OVERFLOW | IN_ISDIR | IN_UNMOUNT)))
return Qnil;
if (ev->len > 0)
(inotify-rm-watch wd)
(should-not (inotify-valid-p wd)))))))
+(ert-deftest inotify-file-watch-stop-delivery ()
+ "Test whether IN_IGNORE events are delivered."
+ (skip-unless (featurep 'inotify))
+ (progn
+ (ert-with-temp-file temp-file
+ (inotify-add-watch
+ temp-file t (lambda (event)
+ (when (memq 'ignored (cadr event))
+ (throw 'success t)))))
+ (should (catch 'success (recursive-edit) nil))))
+
(provide 'inotify-tests)
;;; inotify-tests.el ends here