summaryrefslogtreecommitdiff
path: root/Src/Modules/zftp.c
diff options
context:
space:
mode:
authordana <dana@dana.is>2024-12-26 09:36:45 -0600
committerdana <dana@dana.is>2024-12-26 10:09:25 -0600
commit6bb792dba89016c250bc9f2581c9c267dd322254 (patch)
tree436bc0514ff4a7d63c12af2aadc060f8ed645788 /Src/Modules/zftp.c
parent7798fd88ac42f55980fb9832f2f7e379392fe6aa (diff)
downloadzsh-6bb792dba89016c250bc9f2581c9c267dd322254.tar.gz
zsh-6bb792dba89016c250bc9f2581c9c267dd322254.zip
53257: use monotonic clock where appropriate
update the following features to use the monotonic clock for calculating time deltas and intervals: * MAILCHECK parameter * PERIOD parameter * SECONDS parameter * %(nS.t.f) prompt-expansion sequence * time built-in's elapsed time and cpu % values * zsh/zftp ZFTP_TMOUT parameter * zsh/zprof timings also use CLOCK_MONOTONIC_RAW instead of CLOCK_MONOTONIC on macOS
Diffstat (limited to 'Src/Modules/zftp.c')
-rw-r--r--Src/Modules/zftp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index b60e5bf31..230ad86f6 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -397,7 +397,7 @@ zfalarm(int tmout)
signal(SIGALRM, zfhandler);
oalremain = alarm(tmout);
if (oalremain)
- oaltime = time(NULL);
+ oaltime = zmonotime(NULL);
/*
* We'll leave sigtrapped, sigfuncs and TRAPXXX as they are; since the
* shell's handler doesn't get the signal, they don't matter.
@@ -431,7 +431,7 @@ zfunalarm(void)
* I love the way alarm() uses unsigned int while time_t
* is probably something completely different.
*/
- unsigned int tdiff = time(NULL) - oaltime;
+ time_t tdiff = zmonotime(NULL) - oaltime;
alarm(oalremain < tdiff ? 1 : oalremain - tdiff);
} else
alarm(0);