summaryrefslogtreecommitdiff
path: root/audio/espeak/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'audio/espeak/patches/patch-aa')
-rw-r--r--audio/espeak/patches/patch-aa22
1 files changed, 22 insertions, 0 deletions
diff --git a/audio/espeak/patches/patch-aa b/audio/espeak/patches/patch-aa
new file mode 100644
index 00000000000..833739f6546
--- /dev/null
+++ b/audio/espeak/patches/patch-aa
@@ -0,0 +1,22 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/07/17 19:18:44 drochner Exp $
+
+--- event.cpp.orig 2007-07-17 14:24:45.000000000 +0200
++++ event.cpp
+@@ -398,10 +398,14 @@ ENTER("sleep_until_timeout_or_stop_reque
+ to.tv_sec, to.tv_nsec,
+ ts.tv_sec, ts.tv_nsec);
+
+- while ((err = sem_timedwait(&my_sem_stop_is_required, &ts)) == -1
+- && errno == EINTR)
++ while ((err = sem_trywait(&my_sem_stop_is_required)) == -1
++ && (errno == EINTR || errno == EAGAIN))
+ {
+- continue; // Restart when interrupted by handler
++ struct timespec help;
++ clock_gettime2(&help);
++ if (timespeccmp(&help, &ts, >=))
++ break;
++ sched_yield();
+ }
+
+ assert (gettimeofday(&tv, NULL) != -1);