summaryrefslogtreecommitdiff
path: root/lib/copy-file-range.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-08-23 18:18:13 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2022-08-25 18:30:11 -0700
commit9bd91a3751cfb01c9499a5ee7080349b9c8f0f65 (patch)
tree3a701007f17cd937d00ec0e844fd5426014c4efc /lib/copy-file-range.c
parent97067349a8d75ab720ff2e98653a6b21f60b221e (diff)
downloademacs-9bd91a3751cfb01c9499a5ee7080349b9c8f0f65.tar.gz
emacs-9bd91a3751cfb01c9499a5ee7080349b9c8f0f65.tar.bz2
emacs-9bd91a3751cfb01c9499a5ee7080349b9c8f0f65.zip
Fix overflows in HAVE_XSYNC timestamp handling
Also, port to platforms lacking CLOCK_MONOTONIC and int64_t, and use 0 more consistently to represent missing timestamps. * src/xterm.h (struct x_display_info): Omit server_time_monotonic_p and server_time_offset if !HAVE_CLOCK_GETTIME since they are unused in that case. * src/xterm.h (struct x_display_info, struct x_output): * src/xterm.c (x_sync_get_monotonic_time) (x_sync_current_monotonic_time, x_sync_note_frame_times): Use int_fast64_t instead of int64_t as POSIX doesn't guarantee the latter. Similarly for uint_fast64_t. (x_sync_get_monotonic_time, x_sync_current_monotonic_time) (x_sync_note_frame_times, x_display_set_last_user_time): Check for integer overflow in time arithmetic. (CLOCK_MONOTONIC): Define to CLOCK_REALTIME if absent. (x_sync_current_monotonic_time): Check for clock_gettime failure and fall back on CLOCK_REALTIME if CLOCK_MONOTONIC does not work, which POSIX allows. (x_sync_current_monotonic_time, x_sync_note_frame_times) (x_display_set_last_user_time): Use 0 more consistently to represent missing timestamps.
Diffstat (limited to 'lib/copy-file-range.c')
0 files changed, 0 insertions, 0 deletions