diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/inotify.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/inotify.c b/src/inotify.c index bcf30ad2b3c..b3e07286902 100644 --- a/src/inotify.c +++ b/src/inotify.c | |||
| @@ -72,10 +72,6 @@ static int inotifyfd = -1; | |||
| 72 | IN_EXCL_UNLINK | 72 | IN_EXCL_UNLINK |
| 73 | IN_MASK_ADD | 73 | IN_MASK_ADD |
| 74 | IN_ONESHOT | 74 | IN_ONESHOT |
| 75 | IN_ONLYDIR | ||
| 76 | |||
| 77 | FIXME: Explain why IN_ONLYDIR is in the list, as it seems to be | ||
| 78 | in the same category as IN_DONT_FOLLOW which is allowed. | ||
| 79 | 75 | ||
| 80 | Each element of this list is of the form (DESCRIPTOR . WATCHES) | 76 | Each element of this list is of the form (DESCRIPTOR . WATCHES) |
| 81 | where no two DESCRIPTOR values are the same. DESCRIPTOR represents | 77 | where no two DESCRIPTOR values are the same. DESCRIPTOR represents |
| @@ -162,6 +158,8 @@ symbol_to_inotifymask (Lisp_Object symb) | |||
| 162 | 158 | ||
| 163 | else if (EQ (symb, Qdont_follow)) | 159 | else if (EQ (symb, Qdont_follow)) |
| 164 | return IN_DONT_FOLLOW; | 160 | return IN_DONT_FOLLOW; |
| 161 | else if (EQ (symb, Qonlydir)) | ||
| 162 | return IN_ONLYDIR; | ||
| 165 | 163 | ||
| 166 | else if (EQ (symb, Qt) || EQ (symb, Qall_events)) | 164 | else if (EQ (symb, Qt) || EQ (symb, Qall_events)) |
| 167 | return IN_ALL_EVENTS; | 165 | return IN_ALL_EVENTS; |
| @@ -397,9 +395,11 @@ all-events or t | |||
| 397 | move | 395 | move |
| 398 | close | 396 | close |
| 399 | 397 | ||
| 400 | The following symbols can also be added to a list of aspects: | 398 | ASPECT can also contain the following symbols, which control whether |
| 399 | the watch descriptor will be created: | ||
| 401 | 400 | ||
| 402 | dont-follow | 401 | dont-follow |
| 402 | onlydir | ||
| 403 | 403 | ||
| 404 | Watching a directory is not recursive. CALLBACK is passed a single argument | 404 | Watching a directory is not recursive. CALLBACK is passed a single argument |
| 405 | EVENT which contains an event structure of the format | 405 | EVENT which contains an event structure of the format |
| @@ -430,15 +430,14 @@ shared across different callers. | |||
| 430 | 430 | ||
| 431 | IN_EXCL_UNLINK | 431 | IN_EXCL_UNLINK |
| 432 | IN_MASK_ADD | 432 | IN_MASK_ADD |
| 433 | IN_ONESHOT | 433 | IN_ONESHOT */) |
| 434 | IN_ONLYDIR */) | ||
| 435 | (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback) | 434 | (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback) |
| 436 | { | 435 | { |
| 437 | Lisp_Object encoded_file_name; | 436 | Lisp_Object encoded_file_name; |
| 438 | int wd = -1; | 437 | int wd = -1; |
| 439 | uint32_t imask = aspect_to_inotifymask (aspect); | 438 | uint32_t imask = aspect_to_inotifymask (aspect); |
| 440 | uint32_t mask = (INOTIFY_DEFAULT_MASK | 439 | uint32_t mask = (INOTIFY_DEFAULT_MASK |
| 441 | | (imask & IN_DONT_FOLLOW)); | 440 | | (imask & (IN_DONT_FOLLOW | IN_ONLYDIR))); |
| 442 | 441 | ||
| 443 | CHECK_STRING (filename); | 442 | CHECK_STRING (filename); |
| 444 | 443 | ||
| @@ -548,6 +547,7 @@ syms_of_inotify (void) | |||
| 548 | DEFSYM (Qclose, "close"); /* IN_CLOSE */ | 547 | DEFSYM (Qclose, "close"); /* IN_CLOSE */ |
| 549 | 548 | ||
| 550 | DEFSYM (Qdont_follow, "dont-follow"); /* IN_DONT_FOLLOW */ | 549 | DEFSYM (Qdont_follow, "dont-follow"); /* IN_DONT_FOLLOW */ |
| 550 | DEFSYM (Qonlydir, "onlydir"); /* IN_ONLYDIR */ | ||
| 551 | 551 | ||
| 552 | DEFSYM (Qignored, "ignored"); /* IN_IGNORED */ | 552 | DEFSYM (Qignored, "ignored"); /* IN_IGNORED */ |
| 553 | DEFSYM (Qisdir, "isdir"); /* IN_ISDIR */ | 553 | DEFSYM (Qisdir, "isdir"); /* IN_ISDIR */ |