From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwELB-000749-UG for qemu-devel@nongnu.org; Fri, 18 Jan 2013 10:58:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwEL9-0005YK-5N for qemu-devel@nongnu.org; Fri, 18 Jan 2013 10:58:49 -0500 Received: from mout.web.de ([212.227.17.11]:56717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwEL8-0005Xf-Pv for qemu-devel@nongnu.org; Fri, 18 Jan 2013 10:58:47 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 18 Jan 2013 16:58:42 +0100 Message-Id: <1358524722-24542-1-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH RFC for-1.4] qemu-thread-posix: Fix build for OpenBSD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= Avoid an undefined reference to sem_timedwait. Signed-off-by: Andreas Färber --- include/qemu/thread-posix.h | 2 +- util/qemu-thread-posix.c | 10 +++++----- 2 Dateien geändert, 6 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h index 0f30dcc..772d925 100644 --- a/include/qemu/thread-posix.h +++ b/include/qemu/thread-posix.h @@ -12,7 +12,7 @@ struct QemuCond { }; struct QemuSemaphore { -#if defined(__APPLE__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) pthread_mutex_t lock; pthread_cond_t cond; int count; diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 4489abf..fa8a3d8 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -122,7 +122,7 @@ void qemu_sem_init(QemuSemaphore *sem, int init) { int rc; -#if defined(__APPLE__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) rc = pthread_mutex_init(&sem->lock, NULL); if (rc != 0) { error_exit(rc, __func__); @@ -147,7 +147,7 @@ void qemu_sem_destroy(QemuSemaphore *sem) { int rc; -#if defined(__APPLE__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) rc = pthread_cond_destroy(&sem->cond); if (rc < 0) { error_exit(rc, __func__); @@ -168,7 +168,7 @@ void qemu_sem_post(QemuSemaphore *sem) { int rc; -#if defined(__APPLE__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) pthread_mutex_lock(&sem->lock); if (sem->count == INT_MAX) { rc = EINVAL; @@ -206,7 +206,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms) int rc; struct timespec ts; -#if defined(__APPLE__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) compute_abs_deadline(&ts, ms); pthread_mutex_lock(&sem->lock); --sem->count; @@ -249,7 +249,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms) void qemu_sem_wait(QemuSemaphore *sem) { -#if defined(__APPLE__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) pthread_mutex_lock(&sem->lock); --sem->count; while (sem->count < 0) { -- 1.7.10.4