aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <thomas.voss@humanwave.nl> 2024-02-14 17:08:30 +0100
committerThomas Voss <thomas.voss@humanwave.nl> 2024-02-14 17:08:30 +0100
commit50dd7507c103e01c23f5910041aaeb48067abfdb (patch)
treec1fff1c76bd450d023f9dedd918afb3e6997f924 /src
parent52129a6835499bd4a85252ae121dac357361fbda (diff)
Check return value of clock_gettime()
Diffstat (limited to 'src')
-rw-r--r--src/ahoy/emulator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ahoy/emulator.c b/src/ahoy/emulator.c
index 100d70c..1298ea0 100644
--- a/src/ahoy/emulator.c
+++ b/src/ahoy/emulator.c
@@ -84,7 +84,8 @@ emulate(struct u8view prog)
PC = MEM_RESERVED;
memcpy(mem + PC, prog.p, prog.len);
- clock_gettime(CLOCK_REALTIME, &tp);
+ if (clock_gettime(CLOCK_REALTIME, &tp) == -1)
+ die("clock_gettime");
srand(tp.tv_sec ^ tp.tv_nsec);
for (;; PC += 2) {