diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-08 04:02:13 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-08 04:02:13 -0600 |
commit | db1b4b4cc41c84ec4c8e11418431a1ab2a1001c5 (patch) | |
tree | 54fa10580413b4b1dfbd9b22a52fffca834f772e /libhw_cr/host_alarmclock.c | |
parent | bc1c776e238fb15444f7aa74da9c4d0edc50906b (diff) | |
parent | 53d0b11262177cd212803fc9330e055871c348b3 (diff) |
Merge remote-tracking branch 'origin/main' into lukeshu/fix-obj-box
Diffstat (limited to 'libhw_cr/host_alarmclock.c')
-rw-r--r-- | libhw_cr/host_alarmclock.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libhw_cr/host_alarmclock.c b/libhw_cr/host_alarmclock.c index ac2093c..325f7e0 100644 --- a/libhw_cr/host_alarmclock.c +++ b/libhw_cr/host_alarmclock.c @@ -5,9 +5,12 @@ */ #include <errno.h> -#include <error.h> #include <signal.h> +#define error __error +#include <error.h> +#undef error + #include <libcr/coroutine.h> #include <libmisc/assert.h> @@ -27,7 +30,7 @@ static uint64_t hostclock_get_time_ns(struct hostclock *alarmclock) { struct timespec ts; if (clock_gettime(alarmclock->clock_id, &ts) != 0) - error(1, errno, "clock_gettime(%d)", (int)alarmclock->clock_id); + __error(1, errno, "clock_gettime(%d)", (int)alarmclock->clock_id); return ns_from_host_ns_time(ts); } @@ -52,7 +55,7 @@ static void hostclock_handle_sig_alarm(int LM_UNUSED(sig), siginfo_t *info, void .it_interval = {}, }; if (timer_settime(alarmclock->timer_id, TIMER_ABSTIME, &alarmspec, NULL) != 0) - error(1, errno, "timer_settime"); + __error(1, errno, "timer_settime"); } } @@ -93,9 +96,9 @@ static bool hostclock_add_trigger(struct hostclock *alarmclock, .sa_sigaction = hostclock_handle_sig_alarm, }; if (sigaction(how_to_notify.sigev_signo, &action, NULL) != 0) - error(1, errno, "sigaction"); + __error(1, errno, "sigaction"); if (timer_create(alarmclock->clock_id, &how_to_notify, &alarmclock->timer_id) != 0) - error(1, errno, "timer_create(%d)", (int)alarmclock->clock_id); + __error(1, errno, "timer_create(%d)", (int)alarmclock->clock_id); alarmclock->initialized = true; } if (alarmclock->queue == trigger) { @@ -104,7 +107,7 @@ static bool hostclock_add_trigger(struct hostclock *alarmclock, .it_interval = {}, }; if (timer_settime(alarmclock->timer_id, TIMER_ABSTIME, &alarmspec, NULL) != 0) - error(1, errno, "timer_settime"); + __error(1, errno, "timer_settime"); } cr_restore_interrupts(saved); |