diff options
| author | YAMAMOTO Mitsuharu | 2019-04-27 18:33:39 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2019-04-27 18:33:39 +0900 |
| commit | 886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28 (patch) | |
| tree | b5770d9fc10a704ad8aeb3474c6940121252c770 /src/kqueue.c | |
| parent | 015a6e1df2772bd43680df5cbeaffccf98a881da (diff) | |
| parent | 8dc00b2f1e6523c634df3e24379afbe712a32b27 (diff) | |
| download | emacs-886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28.tar.gz emacs-886bedb36c7b959b7e6fc8ce8e0c04e144b0ae28.zip | |
Merge branch 'master' into harfbuzz
Diffstat (limited to 'src/kqueue.c')
| -rw-r--r-- | src/kqueue.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/kqueue.c b/src/kqueue.c index bc01ab5062c..42391f84677 100644 --- a/src/kqueue.c +++ b/src/kqueue.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Filesystem notifications support with kqueue API. | 1 | /* Filesystem notifications support with kqueue API. |
| 2 | 2 | ||
| 3 | Copyright (C) 2015-2018 Free Software Foundation, Inc. | 3 | Copyright (C) 2015-2019 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 19 | 19 | ||
| 20 | #include <config.h> | 20 | #include <config.h> |
| 21 | 21 | ||
| 22 | #ifdef HAVE_KQUEUE | ||
| 23 | #include <stdio.h> | 22 | #include <stdio.h> |
| 24 | #include <sys/types.h> | 23 | #include <sys/types.h> |
| 25 | #include <sys/event.h> | 24 | #include <sys/event.h> |
| @@ -99,7 +98,7 @@ kqueue_generate_event (Lisp_Object watch_object, Lisp_Object actions, | |||
| 99 | event.arg = list2 (Fcons (XCAR (watch_object), | 98 | event.arg = list2 (Fcons (XCAR (watch_object), |
| 100 | Fcons (actions, | 99 | Fcons (actions, |
| 101 | NILP (file1) | 100 | NILP (file1) |
| 102 | ? Fcons (file, Qnil) | 101 | ? list1 (file) |
| 103 | : list2 (file, file1))), | 102 | : list2 (file, file1))), |
| 104 | Fnth (make_fixnum (3), watch_object)); | 103 | Fnth (make_fixnum (3), watch_object)); |
| 105 | kbd_buffer_store_event (&event); | 104 | kbd_buffer_store_event (&event); |
| @@ -395,11 +394,12 @@ only when the upper directory of the renamed file is watched. */) | |||
| 395 | maxfd = 256; | 394 | maxfd = 256; |
| 396 | 395 | ||
| 397 | /* We assume 50 file descriptors are sufficient for the rest of Emacs. */ | 396 | /* We assume 50 file descriptors are sufficient for the rest of Emacs. */ |
| 398 | if ((maxfd - 50) < XFIXNUM (Flength (watch_list))) | 397 | ptrdiff_t watch_list_len = list_length (watch_list); |
| 398 | if (maxfd - 50 < watch_list_len) | ||
| 399 | xsignal2 | 399 | xsignal2 |
| 400 | (Qfile_notify_error, | 400 | (Qfile_notify_error, |
| 401 | build_string ("File watching not possible, no file descriptor left"), | 401 | build_string ("File watching not possible, no file descriptor left"), |
| 402 | Flength (watch_list)); | 402 | make_fixnum (watch_list_len)); |
| 403 | 403 | ||
| 404 | if (kqueuefd < 0) | 404 | if (kqueuefd < 0) |
| 405 | { | 405 | { |
| @@ -532,8 +532,6 @@ syms_of_kqueue (void) | |||
| 532 | Fprovide (intern_c_string ("kqueue"), Qnil); | 532 | Fprovide (intern_c_string ("kqueue"), Qnil); |
| 533 | } | 533 | } |
| 534 | 534 | ||
| 535 | #endif /* HAVE_KQUEUE */ | ||
| 536 | |||
| 537 | /* PROBLEMS | 535 | /* PROBLEMS |
| 538 | * https://bugs.launchpad.net/ubuntu/+source/libkqueue/+bug/1514837 | 536 | * https://bugs.launchpad.net/ubuntu/+source/libkqueue/+bug/1514837 |
| 539 | prevents tests on Ubuntu. */ | 537 | prevents tests on Ubuntu. */ |