diff options
| author | Michael Albinus | 2017-03-26 09:42:40 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-03-26 09:42:40 +0200 |
| commit | 74129db63d690747c008b1b5d442fe41056584c3 (patch) | |
| tree | 9823da4c0bd892cd7348ba9037a59e8ea2ef558f /src | |
| parent | 158bb8555dfefa50f6118be6794d0424cc52d291 (diff) | |
| download | emacs-74129db63d690747c008b1b5d442fe41056584c3.tar.gz emacs-74129db63d690747c008b1b5d442fe41056584c3.zip | |
; Format files from last commit
Diffstat (limited to 'src')
| -rw-r--r-- | src/inotify.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/inotify.c b/src/inotify.c index a084552adcb..470b60ba893 100644 --- a/src/inotify.c +++ b/src/inotify.c | |||
| @@ -61,7 +61,7 @@ static int inotifyfd = -1; | |||
| 61 | IN_ONLYDIR | 61 | IN_ONLYDIR |
| 62 | 62 | ||
| 63 | Format: (descriptor . ((id filename callback mask) ...)) | 63 | Format: (descriptor . ((id filename callback mask) ...)) |
| 64 | */ | 64 | */ |
| 65 | static Lisp_Object watch_list; | 65 | static Lisp_Object watch_list; |
| 66 | 66 | ||
| 67 | static Lisp_Object | 67 | static Lisp_Object |
| @@ -204,9 +204,10 @@ inotifyevent_to_event (Lisp_Object watch, struct inotify_event const *ev) | |||
| 204 | 204 | ||
| 205 | /* Add a new watch to watch-descriptor WD watching FILENAME and using | 205 | /* Add a new watch to watch-descriptor WD watching FILENAME and using |
| 206 | CALLBACK. Returns a cons (DESCRIPTOR . ID) uniquely identifying the | 206 | CALLBACK. Returns a cons (DESCRIPTOR . ID) uniquely identifying the |
| 207 | new watch. */ | 207 | new watch. */ |
| 208 | static Lisp_Object | 208 | static Lisp_Object |
| 209 | add_watch (int wd, Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback) | 209 | add_watch (int wd, Lisp_Object filename, |
| 210 | Lisp_Object aspect, Lisp_Object callback) | ||
| 210 | { | 211 | { |
| 211 | Lisp_Object descriptor = make_number (wd); | 212 | Lisp_Object descriptor = make_number (wd); |
| 212 | Lisp_Object elt = Fassoc (descriptor, watch_list); | 213 | Lisp_Object elt = Fassoc (descriptor, watch_list); |
| @@ -260,7 +261,7 @@ remove_descriptor (Lisp_Object descriptor, bool invalid_p) | |||
| 260 | } | 261 | } |
| 261 | } | 262 | } |
| 262 | 263 | ||
| 263 | /* Remove watch associated with (descriptor, id). */ | 264 | /* Remove watch associated with (descriptor, id). */ |
| 264 | static void | 265 | static void |
| 265 | remove_watch (Lisp_Object descriptor, Lisp_Object id) | 266 | remove_watch (Lisp_Object descriptor, Lisp_Object id) |
| 266 | { | 267 | { |
| @@ -273,7 +274,7 @@ remove_watch (Lisp_Object descriptor, Lisp_Object id) | |||
| 273 | if (! NILP (watch)) | 274 | if (! NILP (watch)) |
| 274 | XSETCDR (elt, Fdelete (watch, XCDR (elt))); | 275 | XSETCDR (elt, Fdelete (watch, XCDR (elt))); |
| 275 | 276 | ||
| 276 | /* Remove the descriptor if noone is watching it. */ | 277 | /* Remove the descriptor if noone is watching it. */ |
| 277 | if (NILP (XCDR (elt))) | 278 | if (NILP (XCDR (elt))) |
| 278 | remove_descriptor (descriptor, false); | 279 | remove_descriptor (descriptor, false); |
| 279 | } | 280 | } |
| @@ -378,13 +379,12 @@ unmount | |||
| 378 | 379 | ||
| 379 | If a directory is watched then NAME is the name of file that caused the event. | 380 | If a directory is watched then NAME is the name of file that caused the event. |
| 380 | 381 | ||
| 381 | COOKIE is an object that can be compared using `equal' to identify two matchingt | 382 | COOKIE is an object that can be compared using `equal' to identify two matching |
| 382 | renames (moved-from and moved-to). | 383 | renames (moved-from and moved-to). |
| 383 | 384 | ||
| 384 | See inotify(7) and inotify_add_watch(2) for further information. The inotify fd | 385 | See inotify(7) and inotify_add_watch(2) for further information. The inotify fd |
| 385 | is managed internally and there is no corresponding inotify_init. Use | 386 | is managed internally and there is no corresponding inotify_init. Use |
| 386 | `inotify-rm-watch' to remove a watch. | 387 | `inotify-rm-watch' to remove a watch. */) |
| 387 | */) | ||
| 388 | (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback) | 388 | (Lisp_Object filename, Lisp_Object aspect, Lisp_Object callback) |
| 389 | { | 389 | { |
| 390 | Lisp_Object encoded_file_name; | 390 | Lisp_Object encoded_file_name; |
| @@ -417,8 +417,7 @@ DEFUN ("inotify-rm-watch", Finotify_rm_watch, Sinotify_rm_watch, 1, 1, 0, | |||
| 417 | 417 | ||
| 418 | WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. | 418 | WATCH-DESCRIPTOR should be an object returned by `inotify-add-watch'. |
| 419 | 419 | ||
| 420 | See inotify_rm_watch(2) for more information. | 420 | See inotify_rm_watch(2) for more information. */) |
| 421 | */) | ||
| 422 | (Lisp_Object watch_descriptor) | 421 | (Lisp_Object watch_descriptor) |
| 423 | { | 422 | { |
| 424 | 423 | ||
| @@ -462,13 +461,13 @@ it invalid. */) | |||
| 462 | 461 | ||
| 463 | #ifdef INOTIFY_DEBUG | 462 | #ifdef INOTIFY_DEBUG |
| 464 | DEFUN ("inotify-watch-list", Finotify_watch_list, Sinotify_watch_list, 0, 0, 0, | 463 | DEFUN ("inotify-watch-list", Finotify_watch_list, Sinotify_watch_list, 0, 0, 0, |
| 465 | doc: /* Return a copy of the internal watch_list. */) | 464 | doc: /* Return a copy of the internal watch_list. */) |
| 466 | { | 465 | { |
| 467 | return Fcopy_sequence (watch_list); | 466 | return Fcopy_sequence (watch_list); |
| 468 | } | 467 | } |
| 469 | 468 | ||
| 470 | DEFUN ("inotify-allocated-p", Finotify_allocated_p, Sinotify_allocated_p, 0, 0, 0, | 469 | DEFUN ("inotify-allocated-p", Finotify_allocated_p, Sinotify_allocated_p, 0, 0, 0, |
| 471 | doc: /* Return non-nil, if a inotify instance is allocated. */) | 470 | doc: /* Return non-nil, if a inotify instance is allocated. */) |
| 472 | { | 471 | { |
| 473 | return inotifyfd < 0 ? Qnil : Qt; | 472 | return inotifyfd < 0 ? Qnil : Qt; |
| 474 | } | 473 | } |