diff options
Diffstat (limited to 'src/kqueue.c')
| -rw-r--r-- | src/kqueue.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/kqueue.c b/src/kqueue.c index 655bfd58d3b..43e75cac310 100644 --- a/src/kqueue.c +++ b/src/kqueue.c | |||
| @@ -395,11 +395,12 @@ only when the upper directory of the renamed file is watched. */) | |||
| 395 | maxfd = 256; | 395 | maxfd = 256; |
| 396 | 396 | ||
| 397 | /* We assume 50 file descriptors are sufficient for the rest of Emacs. */ | 397 | /* We assume 50 file descriptors are sufficient for the rest of Emacs. */ |
| 398 | if ((maxfd - 50) < XFIXNUM (Flength (watch_list))) | 398 | ptrdiff_t watch_list_len = list_length (watch_list); |
| 399 | if (maxfd - 50 < watch_list_len) | ||
| 399 | xsignal2 | 400 | xsignal2 |
| 400 | (Qfile_notify_error, | 401 | (Qfile_notify_error, |
| 401 | build_string ("File watching not possible, no file descriptor left"), | 402 | build_string ("File watching not possible, no file descriptor left"), |
| 402 | Flength (watch_list)); | 403 | make_fixnum (watch_list_len)); |
| 403 | 404 | ||
| 404 | if (kqueuefd < 0) | 405 | if (kqueuefd < 0) |
| 405 | { | 406 | { |