1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00
freebsd-ports/multimedia/gavl/files/patch-gavl-time.c
2010-03-30 12:11:56 +00:00

25 lines
603 B
C

--- gavl/time.c.orig 2010-01-14 19:32:51.000000000 +0100
+++ gavl/time.c 2010-03-30 13:55:24.113853853 +0200
@@ -44,7 +44,7 @@
/* Sleep for a specified time */
-#ifdef HAVE_CLOCK_MONOTONIC
+#if defined(HAVE_CLOCK_MONOTONIC) || defined(__FreeBSD__)
void gavl_time_delay(gavl_time_t * t)
{
struct timespec tm;
@@ -53,8 +53,12 @@
tm.tv_sec = *t / 1000000;
tm.tv_nsec = (*t % 1000000)*1000;
+#if defined(__FreeBSD__)
+ while(nanosleep(&tm, &rem))
+#else
while(clock_nanosleep(CLOCK_MONOTONIC, 0,
&tm, &rem))
+#endif
{
if(errno == EINTR)
{