[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 858868e: Actually start the alarms in atimer
From: |
Lars Ingebrigtsen |
Subject: |
master 858868e: Actually start the alarms in atimer |
Date: |
Sat, 6 Nov 2021 23:55:28 -0400 (EDT) |
branch: master
commit 858868e36dbb8fe30fb5ae6a59ebb2fd123e307d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Actually start the alarms in atimer
* src/atimer.c (set_alarm): Actually start both timerfd and
alarms (attempted in 4107549a).
---
src/atimer.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/atimer.c b/src/atimer.c
index ab47bbf..490c21b 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -305,6 +305,7 @@ set_alarm (void)
#ifdef HAVE_ITIMERSPEC
if (0 <= timerfd || alarm_timer_ok)
{
+ bool exit = false;
struct itimerspec ispec;
ispec.it_value = atimers->expiration;
ispec.it_interval.tv_sec = ispec.it_interval.tv_nsec = 0;
@@ -312,11 +313,14 @@ set_alarm (void)
if (timerfd_settime (timerfd, TFD_TIMER_ABSTIME, &ispec, 0) == 0)
{
add_timer_wait_descriptor (timerfd);
- return;
+ exit = true;
}
# endif
if (alarm_timer_ok
&& timer_settime (alarm_timer, TIMER_ABSTIME, &ispec, 0) == 0)
+ exit = true;
+
+ if (exit)
return;
}
#endif
@@ -333,9 +337,8 @@ set_alarm (void)
memset (&it, 0, sizeof it);
it.it_value = make_timeval (interval);
setitimer (ITIMER_REAL, &it, 0);
-#else /* not HAVE_SETITIMER */
- alarm (max (interval.tv_sec, 1));
#endif /* not HAVE_SETITIMER */
+ alarm (max (interval.tv_sec, 1));
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 858868e: Actually start the alarms in atimer,
Lars Ingebrigtsen <=