summaryrefslogtreecommitdiff
path: root/src/inotify.c
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2015-09-14 22:15:20 +0200
committerMichael Albinus <michael.albinus@gmx.de>2015-09-14 22:15:20 +0200
commit67ddc7c55d6b40e3d37b2773e002a50123ae7411 (patch)
tree98e4f30f14cc1d0588a7f4b7fbee4e38055f9fca /src/inotify.c
parent1ee47d477ddb9c567eaf63154f78fad5d5826b78 (diff)
downloademacs-67ddc7c55d6b40e3d37b2773e002a50123ae7411.tar.gz
Adaot file-notify-tests.el test cases
* lisp/filenotify.el (file-notify-rm-watch): Ignore `file-notify-error'. * src/inotify.c (Finotify_valid_p): Adapt docstring. * test/automated/file-notify-tests.el () (file-notify-test03-autorevert) (file-notify-test04-file-validity) (file-notify-test04-file-validity-remote) (file-notify-test05-dir-validity) (file-notify-test05-dir-validity-remote): Adapt docstring. (file-notify-test04-file-validity): Let events arrive before calling final `file-notify-valid-p'. Do not ignore errors. (file-notify-test05-dir-validity): Do not manipulate `temporary-file-directory', it isn't necessary. Let events arrive before calling final `file-notify-valid-p'. Do not ignore errors.
Diffstat (limited to 'src/inotify.c')
-rw-r--r--src/inotify.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/inotify.c b/src/inotify.c
index b73e8733829..2486563bf9b 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -323,12 +323,12 @@ is managed internally and there is no corresponding inotify_init. Use
watch_descriptor = make_watch_descriptor (watchdesc);
- /* Delete existing watch object. */
+ /* Delete existing watch object. */
watch_object = Fassoc (watch_descriptor, watch_list);
if (!NILP (watch_object))
watch_list = Fdelete (watch_object, watch_list);
- /* Store watch object in watch list. */
+ /* Store watch object in watch list. */
watch_object = Fcons (watch_descriptor, callback);
watch_list = Fcons (watch_object, watch_list);
@@ -351,12 +351,12 @@ See inotify_rm_watch(2) for more information.
xsignal2 (Qfile_notify_error,
build_string ("Could not rm watch"), watch_descriptor);
- /* Remove watch descriptor from watch list. */
+ /* Remove watch descriptor from watch list. */
watch_object = Fassoc (watch_descriptor, watch_list);
if (!NILP (watch_object))
watch_list = Fdelete (watch_object, watch_list);
- /* Cleanup if no more files are watched. */
+ /* Cleanup if no more files are watched. */
if (NILP (watch_list))
{
emacs_close (inotifyfd);
@@ -370,7 +370,12 @@ See inotify_rm_watch(2) for more information.
DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0,
doc: /* "Check a watch specified by its WATCH-DESCRIPTOR.
-WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. */)
+WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'.
+
+A watch can become invalid if the file or directory it watches is
+deleted, or if the watcher thread exits abnormally for any other
+reason. Removing the watch by calling `inotify-rm-watch' also makes
+it invalid. */)
(Lisp_Object watch_descriptor)
{
Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);