aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Albinus2024-06-23 12:52:41 +0200
committerMichael Albinus2024-06-23 12:52:41 +0200
commit774016b275ed37cc86cbe937008ee63e9c4d68b6 (patch)
tree9de295d7a164c5cd07f2ba59de50e576290ea3f5 /src
parentc95caade15d295fa6cc31d337028faa15142b388 (diff)
parent60475a73d17d293f5c1e82bc5b3c058b414266e8 (diff)
downloademacs-774016b275ed37cc86cbe937008ee63e9c4d68b6.tar.gz
emacs-774016b275ed37cc86cbe937008ee63e9c4d68b6.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c13
-rw-r--r--src/kqueue.c37
-rw-r--r--src/timefns.c8
3 files changed, 39 insertions, 19 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 9955f83e625..7afe3e75737 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6531,7 +6531,18 @@ If the underlying system call fails, value is nil. */)
6531 || defined STAT_STATFS4 || defined STAT_STATVFS \ 6531 || defined STAT_STATFS4 || defined STAT_STATVFS \
6532 || defined STAT_STATVFS64 6532 || defined STAT_STATVFS64
6533 struct fs_usage u; 6533 struct fs_usage u;
6534 if (get_fs_usage (SSDATA (ENCODE_FILE (filename)), NULL, &u) != 0) 6534 const char *name;
6535
6536 name = SSDATA (ENCODE_FILE (filename));
6537
6538#if defined HAVE_ANDROID && !defined ANDROID_STUBIFY
6539 /* With special directories, this information is unavailable. */
6540 if (android_is_special_directory (name, "/assets")
6541 || android_is_special_directory (name, "/content"))
6542 return Qnil;
6543#endif /* defined HAVE_ANDROID && !defined ANDROID_STUBIFY */
6544
6545 if (get_fs_usage (name, NULL, &u) != 0)
6535 return errno == ENOSYS ? Qnil : file_attribute_errno (filename, errno); 6546 return errno == ENOSYS ? Qnil : file_attribute_errno (filename, errno);
6536 return list3 (blocks_to_bytes (u.fsu_blocksize, u.fsu_blocks, false), 6547 return list3 (blocks_to_bytes (u.fsu_blocksize, u.fsu_blocks, false),
6537 blocks_to_bytes (u.fsu_blocksize, u.fsu_bfree, false), 6548 blocks_to_bytes (u.fsu_blocksize, u.fsu_bfree, false),
diff --git a/src/kqueue.c b/src/kqueue.c
index 4693e130208..aabaab6c8c3 100644
--- a/src/kqueue.c
+++ b/src/kqueue.c
@@ -444,23 +444,29 @@ only when the upper directory of the renamed file is watched. */)
444 if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE; 444 if (! NILP (Fmember (Qrevoke, flags))) fflags |= NOTE_REVOKE;
445 445
446 /* Register event. */ 446 /* Register event. */
447 EV_SET (&kev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, 447 EV_SET (&kev, fd, EVFILT_VNODE, (EV_ADD
448#ifdef EV_ENABLE
449 | EV_ENABLE
450#endif /* EV_ENABLE */
451 | EV_CLEAR),
448 fflags, 0, NULL); 452 fflags, 0, NULL);
449 453
450 if (kevent (kqueuefd, &kev, 1, NULL, 0, NULL) < 0) { 454 if (kevent (kqueuefd, &kev, 1, NULL, 0, NULL) < 0)
451 emacs_close (fd); 455 {
452 report_file_error ("Cannot watch file", file); 456 emacs_close (fd);
453 } 457 report_file_error ("Cannot watch file", file);
458 }
454 459
455 /* Store watch object in watch list. */ 460 /* Store watch object in watch list. */
456 Lisp_Object watch_descriptor = make_fixnum (fd); 461 Lisp_Object watch_descriptor = make_fixnum (fd);
457 if (NILP (Ffile_directory_p (file))) 462 if (NILP (Ffile_directory_p (file)))
458 watch_object = list4 (watch_descriptor, file, flags, callback); 463 watch_object = list4 (watch_descriptor, file, flags, callback);
459 else { 464 else
460 dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil, 465 {
461 Qnil); 466 dir_list = directory_files_internal (file, Qnil, Qnil, Qnil, true, Qnil,
462 watch_object = list5 (watch_descriptor, file, flags, callback, dir_list); 467 Qnil);
463 } 468 watch_object = list5 (watch_descriptor, file, flags, callback, dir_list);
469 }
464 watch_list = Fcons (watch_object, watch_list); 470 watch_list = Fcons (watch_object, watch_list);
465 471
466 return watch_descriptor; 472 return watch_descriptor;
@@ -486,11 +492,12 @@ WATCH-DESCRIPTOR should be an object returned by `kqueue-add-watch'. */)
486 /* Remove watch descriptor from watch list. */ 492 /* Remove watch descriptor from watch list. */
487 watch_list = Fdelq (watch_object, watch_list); 493 watch_list = Fdelq (watch_object, watch_list);
488 494
489 if (NILP (watch_list) && (kqueuefd >= 0)) { 495 if (NILP (watch_list) && (kqueuefd >= 0))
490 delete_read_fd (kqueuefd); 496 {
491 emacs_close (kqueuefd); 497 delete_read_fd (kqueuefd);
492 kqueuefd = -1; 498 emacs_close (kqueuefd);
493 } 499 kqueuefd = -1;
500 }
494 501
495 return Qt; 502 return Qt;
496} 503}
diff --git a/src/timefns.c b/src/timefns.c
index 0ecbb6e6793..746e422ffb6 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -414,9 +414,11 @@ decode_float_time (double t, struct lisp_time *result)
414 else 414 else
415 { 415 {
416 int scale = double_integer_scale (t); 416 int scale = double_integer_scale (t);
417 /* FIXME: `double_integer_scale` often returns values that are 417 /* Because SCALE treats trailing zeros in T as significant,
418 "pessimistic" (i.e. larger than necessary), so 3.5 gets converted 418 on typical platforms with IEEE floating point
419 to (7881299347898368 . 2251799813685248) rather than (7 . 2). 419 (time-convert 3.5 t) yields (7881299347898368 . 2251799813685248),
420 a precision of 2**-51 s, not (7 . 2), a precision of 0.5 s.
421 Although numerically correct, this generates largish integers.
420 On 64bit systems, this should not matter very much, tho. */ 422 On 64bit systems, this should not matter very much, tho. */
421 eassume (scale < flt_radix_power_size); 423 eassume (scale < flt_radix_power_size);
422 424