mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
Merge branch 'timespec-compare-fix' into master
This commit is contained in:
commit
75dc06f303
1 changed files with 9 additions and 3 deletions
12
csi.c
12
csi.c
|
|
@ -544,6 +544,12 @@ decrst(struct terminal *term, unsigned param)
|
|||
decset_decrst(term, param, false);
|
||||
}
|
||||
|
||||
static bool
|
||||
timespecs_equal(const struct timespec *a, const struct timespec *b)
|
||||
{
|
||||
return a->tv_sec == b->tv_sec && a->tv_nsec == b->tv_nsec;
|
||||
}
|
||||
|
||||
static void
|
||||
xtsave(struct terminal *term, unsigned param)
|
||||
{
|
||||
|
|
@ -561,10 +567,10 @@ xtsave(struct terminal *term, unsigned param)
|
|||
if (timerfd_gettime(term->cursor_blink.fd, ¤t_value) < 0)
|
||||
LOG_WARN("xtsave: failed to read cursor blink timer: %s", strerror(errno));
|
||||
else {
|
||||
const struct timespec zero = {};
|
||||
const struct timespec zero = {.tv_sec = 0, .tv_nsec = 0};
|
||||
term->xtsave.cursor_blink =
|
||||
!(memcmp(¤t_value.it_interval, &zero, sizeof(zero)) == 0 &&
|
||||
memcmp(¤t_value.it_value, &zero, sizeof(zero)) == 0);
|
||||
!(timespecs_equal(¤t_value.it_interval, &zero) &&
|
||||
timespecs_equal(¤t_value.it_value, &zero));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue