Newer
Older
minerva / Ports / c-ray / patches / 0005-Use-usleep-on-minerva.patch
@minerva minerva on 13 Jul 942 bytes Initial commit
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Linus Groh <mail@linusgroh.de>
Date: Sat, 13 Mar 2021 22:11:07 +0100
Subject: [PATCH] Use usleep() on minerva

Co-Authored-By: Valtteri Koskivuori <vkoskiv@gmail.com>
---
 src/utils/timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils/timer.c b/src/utils/timer.c
index dd83497..3a4357f 100644
--- a/src/utils/timer.c
+++ b/src/utils/timer.c
@@ -48,7 +48,7 @@ long getUs(struct timeval timer) {
 	return ((tmr2.tv_sec - timer.tv_sec) * 1000000) + (tmr2.tv_usec - timer.tv_usec);
 }
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__minerva__)
 #define _BSD_SOURCE
 #include <unistd.h>
 #endif
@@ -66,7 +66,7 @@ void sleepMSec(int ms) {
 	ts.tv_sec = ms / 1000;
 	ts.tv_nsec = (ms % 1000) * 1000000;
 	nanosleep(&ts, NULL);
-#elif __linux__
+#elif defined(__linux__) || defined(__minerva__)
 	usleep(ms * 1000);
 #endif
 }