diff options
Diffstat (limited to 'src/kqueue.c')
-rw-r--r-- | src/kqueue.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/kqueue.c b/src/kqueue.c index 69d5269d302..bc01ab5062c 100644 --- a/src/kqueue.c +++ b/src/kqueue.c @@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> -#include <sys/file.h> +#include <fcntl.h> #include "lisp.h" #include "keyboard.h" #include "process.h" @@ -55,15 +55,15 @@ kqueue_directory_listing (Lisp_Object directory_files) result = Fcons (list5 (/* inode. */ - Fnth (make_number (11), XCAR (dl)), + Fnth (make_fixnum (11), XCAR (dl)), /* filename. */ XCAR (XCAR (dl)), /* last modification time. */ - Fnth (make_number (6), XCAR (dl)), + Fnth (make_fixnum (6), XCAR (dl)), /* last status change time. */ - Fnth (make_number (7), XCAR (dl)), + Fnth (make_fixnum (7), XCAR (dl)), /* size. */ - Fnth (make_number (8), XCAR (dl))), + Fnth (make_fixnum (8), XCAR (dl))), result); } return result; @@ -78,7 +78,7 @@ kqueue_generate_event (Lisp_Object watch_object, Lisp_Object actions, struct input_event event; /* Check, whether all actions shall be monitored. */ - flags = Fnth (make_number (2), watch_object); + flags = Fnth (make_fixnum (2), watch_object); action = actions; do { if (NILP (action)) @@ -101,7 +101,7 @@ kqueue_generate_event (Lisp_Object watch_object, Lisp_Object actions, NILP (file1) ? Fcons (file, Qnil) : list2 (file, file1))), - Fnth (make_number (3), watch_object)); + Fnth (make_fixnum (3), watch_object)); kbd_buffer_store_event (&event); } } @@ -121,7 +121,7 @@ kqueue_compare_dir_list (Lisp_Object watch_object) pending_dl = Qnil; deleted_dl = Qnil; - old_directory_files = Fnth (make_number (4), watch_object); + old_directory_files = Fnth (make_fixnum (4), watch_object); old_dl = kqueue_directory_listing (old_directory_files); /* When the directory is not accessible anymore, it has been deleted. */ @@ -155,14 +155,14 @@ kqueue_compare_dir_list (Lisp_Object watch_object) if (strcmp (SSDATA (XCAR (XCDR (old_entry))), SSDATA (XCAR (XCDR (new_entry)))) == 0) { /* Modification time has been changed, the file has been written. */ - if (NILP (Fequal (Fnth (make_number (2), old_entry), - Fnth (make_number (2), new_entry)))) + if (NILP (Fequal (Fnth (make_fixnum (2), old_entry), + Fnth (make_fixnum (2), new_entry)))) kqueue_generate_event (watch_object, Fcons (Qwrite, Qnil), XCAR (XCDR (old_entry)), Qnil); /* Status change time has been changed, the file attributes have changed. */ - if (NILP (Fequal (Fnth (make_number (3), old_entry), - Fnth (make_number (3), new_entry)))) + if (NILP (Fequal (Fnth (make_fixnum (3), old_entry), + Fnth (make_fixnum (3), new_entry)))) kqueue_generate_event (watch_object, Fcons (Qattrib, Qnil), XCAR (XCDR (old_entry)), Qnil); @@ -233,8 +233,8 @@ kqueue_compare_dir_list (Lisp_Object watch_object) (watch_object, Fcons (Qcreate, Qnil), XCAR (XCDR (entry)), Qnil); /* Check size of that file. */ - Lisp_Object size = Fnth (make_number (4), entry); - if (FLOATP (size) || (XINT (size) > 0)) + Lisp_Object size = Fnth (make_fixnum (4), entry); + if (FLOATP (size) || (XFIXNUM (size) > 0)) kqueue_generate_event (watch_object, Fcons (Qwrite, Qnil), XCAR (XCDR (entry)), Qnil); @@ -270,7 +270,7 @@ kqueue_compare_dir_list (Lisp_Object watch_object) report_file_error ("Pending events list not empty", pending_dl); /* Replace old directory listing with the new one. */ - XSETCDR (Fnthcdr (make_number (3), watch_object), + XSETCDR (Fnthcdr (make_fixnum (3), watch_object), Fcons (new_directory_files, Qnil)); return; } @@ -293,7 +293,7 @@ kqueue_callback (int fd, void *data) } /* Determine descriptor and file name. */ - descriptor = make_number (kev.ident); + descriptor = make_fixnum (kev.ident); watch_object = assq_no_quit (descriptor, watch_list); if (CONSP (watch_object)) file = XCAR (XCDR (watch_object)); @@ -306,7 +306,7 @@ kqueue_callback (int fd, void *data) actions = Fcons (Qdelete, actions); if (kev.fflags & NOTE_WRITE) { /* Check, whether this is a directory event. */ - if (NILP (Fnth (make_number (4), watch_object))) + if (NILP (Fnth (make_fixnum (4), watch_object))) actions = Fcons (Qwrite, actions); else kqueue_compare_dir_list (watch_object); @@ -395,7 +395,7 @@ only when the upper directory of the renamed file is watched. */) maxfd = 256; /* We assume 50 file descriptors are sufficient for the rest of Emacs. */ - if ((maxfd - 50) < XINT (Flength (watch_list))) + if ((maxfd - 50) < XFIXNUM (Flength (watch_list))) xsignal2 (Qfile_notify_error, build_string ("File watching not possible, no file descriptor left"), @@ -449,7 +449,7 @@ only when the upper directory of the renamed file is watched. */) } /* Store watch object in watch list. */ - Lisp_Object watch_descriptor = make_number (fd); + Lisp_Object watch_descriptor = make_fixnum (fd); if (NILP (Ffile_directory_p (file))) watch_object = list4 (watch_descriptor, file, flags, callback); else { @@ -473,8 +473,8 @@ WATCH-DESCRIPTOR should be an object returned by `kqueue-add-watch'. */) xsignal2 (Qfile_notify_error, build_string ("Not a watch descriptor"), watch_descriptor); - eassert (INTEGERP (watch_descriptor)); - int fd = XINT (watch_descriptor); + eassert (FIXNUMP (watch_descriptor)); + int fd = XFIXNUM (watch_descriptor); if ( fd >= 0) emacs_close (fd); |