summaryrefslogtreecommitdiff
path: root/linux_timer.c
diff options
context:
space:
mode:
authorPeter Fors <peter.fors@mindkiller.com>2025-12-05 09:34:21 +0100
committerPeter Fors <peter.fors@mindkiller.com>2025-12-05 09:34:21 +0100
commitb35551ddc948be413d179b798a0350eb2202bba8 (patch)
tree508499b149c4aa147311c0993c061939f5b90ab6 /linux_timer.c
parentd1e416e8657521c77a929bab0dae819e51928088 (diff)
workingHEADmaster
Diffstat (limited to 'linux_timer.c')
-rw-r--r--linux_timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux_timer.c b/linux_timer.c
index 9a9d296..6a86fdd 100644
--- a/linux_timer.c
+++ b/linux_timer.c
@@ -101,6 +101,10 @@ static void *timer_thread_func(void *arg) {
static struct timer_handle *timer_new(uint64_t interval_ns) {
struct timer_handle *t = calloc(1, sizeof(struct timer_handle));
+ if(!t) {
+ printf("ERROR: Could not allocate a timer!\n");
+ exit(1);
+ }
t->interval_ns = interval_ns;
clock_gettime(CLOCK_MONOTONIC_RAW, &t->next_deadline);