aboutsummaryrefslogtreecommitdiffstats
path: root/src/kqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kqueue.c')
-rw-r--r--src/kqueue.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/kqueue.c b/src/kqueue.c
index 22c279b7ce3..43d5f40624b 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -320,13 +320,16 @@ kqueue_callback (int fd, void *data)
320 directory is monitored. */ 320 directory is monitored. */
321 if (kev.fflags & NOTE_RENAME) 321 if (kev.fflags & NOTE_RENAME)
322 actions = Fcons (Qrename, actions); 322 actions = Fcons (Qrename, actions);
323 if (kev.fflags & NOTE_REVOKE)
324 actions = Fcons (Qrevoke, actions);
323 325
324 /* Create the event. */ 326 /* Create the event. */
325 if (! NILP (actions)) 327 if (! NILP (actions))
326 kqueue_generate_event (watch_object, actions, file, Qnil); 328 kqueue_generate_event (watch_object, actions, file, Qnil);
327 329
328 /* Cancel monitor if file or directory is deleted or renamed. */ 330 /* Cancel monitor if file or directory is deleted or renamed or
329 if (kev.fflags & (NOTE_DELETE | NOTE_RENAME)) 331 the file system is unmounted. */
332 if (kev.fflags & (NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE))
330 Fkqueue_rm_watch (descriptor); 333 Fkqueue_rm_watch (descriptor);
331 } 334 }
332 return; 335 return;
@@ -351,6 +354,7 @@ following symbols:
351 `attrib' -- a FILE attribute was changed 354 `attrib' -- a FILE attribute was changed
352 `link' -- a FILE's link count was changed 355 `link' -- a FILE's link count was changed
353 `rename' -- FILE was moved to FILE1 356 `rename' -- FILE was moved to FILE1
357 `revoke' -- FILE was unmounted
354 358
355When any event happens, Emacs will call the CALLBACK function passing 359When any event happens, Emacs will call the CALLBACK function passing
356it a single argument EVENT, which is of the form 360it a single argument EVENT, which is of the form
@@ -437,6 +441,7 @@ only when the upper directory of the renamed file is watched. */)
437 if (! NILP (Fmember (Qattrib, flags))) fflags |= NOTE_ATTRIB; 441 if (! NILP (Fmember (Qattrib, flags))) fflags |= NOTE_ATTRIB;
438 if (! NILP (Fmember (Qlink, flags))) fflags |= NOTE_LINK; 442 if (! NILP (Fmember (Qlink, flags))) fflags |= NOTE_LINK;
439 if (! NILP (Fmember (Qrename, flags))) fflags |= NOTE_RENAME; 443 if (! NILP (Fmember (Qrename, flags))) fflags |= NOTE_RENAME;
444 if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE;
440 445
441 /* Register event. */ 446 /* Register event. */
442 EV_SET (&kev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, 447 EV_SET (&kev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR,
@@ -526,6 +531,7 @@ syms_of_kqueue (void)
526 DEFSYM (Qattrib, "attrib"); /* NOTE_ATTRIB */ 531 DEFSYM (Qattrib, "attrib"); /* NOTE_ATTRIB */
527 DEFSYM (Qlink, "link"); /* NOTE_LINK */ 532 DEFSYM (Qlink, "link"); /* NOTE_LINK */
528 DEFSYM (Qrename, "rename"); /* NOTE_RENAME */ 533 DEFSYM (Qrename, "rename"); /* NOTE_RENAME */
534 DEFSYM (Qrevoke, "revoke"); /* NOTE_REVOKE */
529 535
530 staticpro (&watch_list); 536 staticpro (&watch_list);
531 537