aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Albinus2015-09-14 22:15:20 +0200
committerMichael Albinus2015-09-14 22:15:20 +0200
commit67ddc7c55d6b40e3d37b2773e002a50123ae7411 (patch)
tree98e4f30f14cc1d0588a7f4b7fbee4e38055f9fca /src
parent1ee47d477ddb9c567eaf63154f78fad5d5826b78 (diff)
downloademacs-67ddc7c55d6b40e3d37b2773e002a50123ae7411.tar.gz
emacs-67ddc7c55d6b40e3d37b2773e002a50123ae7411.zip
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')
-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
323 323
324 watch_descriptor = make_watch_descriptor (watchdesc); 324 watch_descriptor = make_watch_descriptor (watchdesc);
325 325
326 /* Delete existing watch object. */ 326 /* Delete existing watch object. */
327 watch_object = Fassoc (watch_descriptor, watch_list); 327 watch_object = Fassoc (watch_descriptor, watch_list);
328 if (!NILP (watch_object)) 328 if (!NILP (watch_object))
329 watch_list = Fdelete (watch_object, watch_list); 329 watch_list = Fdelete (watch_object, watch_list);
330 330
331 /* Store watch object in watch list. */ 331 /* Store watch object in watch list. */
332 watch_object = Fcons (watch_descriptor, callback); 332 watch_object = Fcons (watch_descriptor, callback);
333 watch_list = Fcons (watch_object, watch_list); 333 watch_list = Fcons (watch_object, watch_list);
334 334
@@ -351,12 +351,12 @@ See inotify_rm_watch(2) for more information.
351 xsignal2 (Qfile_notify_error, 351 xsignal2 (Qfile_notify_error,
352 build_string ("Could not rm watch"), watch_descriptor); 352 build_string ("Could not rm watch"), watch_descriptor);
353 353
354 /* Remove watch descriptor from watch list. */ 354 /* Remove watch descriptor from watch list. */
355 watch_object = Fassoc (watch_descriptor, watch_list); 355 watch_object = Fassoc (watch_descriptor, watch_list);
356 if (!NILP (watch_object)) 356 if (!NILP (watch_object))
357 watch_list = Fdelete (watch_object, watch_list); 357 watch_list = Fdelete (watch_object, watch_list);
358 358
359 /* Cleanup if no more files are watched. */ 359 /* Cleanup if no more files are watched. */
360 if (NILP (watch_list)) 360 if (NILP (watch_list))
361 { 361 {
362 emacs_close (inotifyfd); 362 emacs_close (inotifyfd);
@@ -370,7 +370,12 @@ See inotify_rm_watch(2) for more information.
370DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0, 370DEFUN ("inotify-valid-p", Finotify_valid_p, Sinotify_valid_p, 1, 1, 0,
371 doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. 371 doc: /* "Check a watch specified by its WATCH-DESCRIPTOR.
372 372
373WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. */) 373WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'.
374
375A watch can become invalid if the file or directory it watches is
376deleted, or if the watcher thread exits abnormally for any other
377reason. Removing the watch by calling `inotify-rm-watch' also makes
378it invalid. */)
374 (Lisp_Object watch_descriptor) 379 (Lisp_Object watch_descriptor)
375{ 380{
376 Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list); 381 Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list);