diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/inotify.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/inotify.c b/src/inotify.c index d1a80bbad1b..6577ee28cd1 100644 --- a/src/inotify.c +++ b/src/inotify.c | |||
| @@ -46,8 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 46 | static int inotifyfd = -1; | 46 | static int inotifyfd = -1; |
| 47 | 47 | ||
| 48 | /* Assoc list of files being watched. | 48 | /* Assoc list of files being watched. |
| 49 | Format: | 49 | Format: (watch-descriptor name callback) |
| 50 | (watch-descriptor . callback) | ||
| 51 | */ | 50 | */ |
| 52 | static Lisp_Object watch_list; | 51 | static Lisp_Object watch_list; |
| 53 | 52 | ||
| @@ -106,12 +105,14 @@ inotifyevent_to_event (Lisp_Object watch_object, struct inotify_event const *ev) | |||
| 106 | name = make_unibyte_string (ev->name, min (len, ev->len)); | 105 | name = make_unibyte_string (ev->name, min (len, ev->len)); |
| 107 | name = DECODE_FILE (name); | 106 | name = DECODE_FILE (name); |
| 108 | } | 107 | } |
| 108 | else | ||
| 109 | name = XCAR (XCDR (watch_object)); | ||
| 109 | 110 | ||
| 110 | return list2 (list4 (make_watch_descriptor (ev->wd), | 111 | return list2 (list4 (make_watch_descriptor (ev->wd), |
| 111 | mask_to_aspects (ev->mask), | 112 | mask_to_aspects (ev->mask), |
| 112 | name, | 113 | name, |
| 113 | make_number (ev->cookie)), | 114 | make_number (ev->cookie)), |
| 114 | XCDR (watch_object)); | 115 | Fnth (make_number (2), watch_object)); |
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | /* This callback is called when the FD is available for read. The inotify | 118 | /* This callback is called when the FD is available for read. The inotify |
| @@ -325,7 +326,7 @@ is managed internally and there is no corresponding inotify_init. Use | |||
| 325 | watch_list = Fdelete (watch_object, watch_list); | 326 | watch_list = Fdelete (watch_object, watch_list); |
| 326 | 327 | ||
| 327 | /* Store watch object in watch list. */ | 328 | /* Store watch object in watch list. */ |
| 328 | watch_object = Fcons (watch_descriptor, callback); | 329 | watch_object = list3 (watch_descriptor, encoded_file_name, callback); |
| 329 | watch_list = Fcons (watch_object, watch_list); | 330 | watch_list = Fcons (watch_object, watch_list); |
| 330 | 331 | ||
| 331 | return watch_descriptor; | 332 | return watch_descriptor; |