]> git.eshelyaron.com Git - emacs.git/commit
Fix issues regarding inotify file-notification
authorAndreas Politz <politza@hochschule-trier.de>
Sun, 26 Mar 2017 07:21:56 +0000 (09:21 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 26 Mar 2017 07:21:56 +0000 (09:21 +0200)
commit158bb8555dfefa50f6118be6794d0424cc52d291
treee55be569b5898834d9a1e8b25586b1ddeb597587
parent9278d904af13c3c083defdcbf5fa21260d4457c3
Fix issues regarding inotify file-notification

Remove special code handling the inotify back-end.
* lisp/filenotify.el (file-notify--watch): New struct
representing a file-watch.
(file-notify-descriptors): Use the new struct as hash-value.
(file-notify-handle-event): Check that event is a cons.
(file-notify--rm-descriptor, file-notify--event-watched-file)
(file-notify--event-file-name, file-notify--event-file1-name)
(file-notify-callback, file-notify-add-watch)
(file-notify-rm-watch, file-notify-valid-p): Use new struct.
Remove special code handling inotify descriptors.  Remove code
handling multiple clients per descriptor.
(file-notify--descriptor): Remove unused function.

Let inotify-add-watch return a unique descriptor on every
call, like every other back-end does (Bug#26126).  Prevent
multiple clients from interfering with each other, when
watching a shared descriptor.
* src/inotify.c (watch_list): Extend the format by including a
id and the provided mask.
(INOTIFY_DEFAULT_MASK): Default mask used for all clients.
(make_watch_descriptor): Removed.
(make_lispy_mask, lispy_mask_match_p): New functions.
(inotifyevent_to_event): Match event against the mask provided
by the client.
(add_watch, remove_descriptor, remove_watch): New functions
for managing the watch_list.
(inotify_callback): Use the new functions.
(Finotify_add_watch, Finotify_rm_watch): Remove deprecated
flags from documentation.  Add check for validity of provided
descriptor.  Use the new functions.  Use the default mask.
(INOTIFY_DEBUG): Add new debug conditional.
(inotify-watch-list, inotify-allocated-p): New debug functions.
(symbol_to_inotifymask, syms_of_inotify): Remove deprecated symbols.

* test/lisp/filenotify-tests.el:
(file-notify-test02-rm-watch): Remove expected failure for inotify.
lisp/filenotify.el
src/inotify.c
test/lisp/filenotify-tests.el