summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-03-02 08:07:43 +0000
committerguenther <guenther@openbsd.org>2012-03-02 08:07:43 +0000
commit1efc366f026941a5f5f7619cbe39bf4b17e2b119 (patch)
tree4eb6551624ae364c92ca100afd2ad82face806a5
parentDon't include ou=People in the basedn. ypldap(8) has had netid support (diff)
downloadwireguard-openbsd-1efc366f026941a5f5f7619cbe39bf4b17e2b119.tar.xz
wireguard-openbsd-1efc366f026941a5f5f7619cbe39bf4b17e2b119.zip
_SPINLOCK_UNLOCKED isn't zero everywhere (*cough*hppa*cough*), so
sem_init() can't assume that calloc will leave the embedded spinlock in the unlocked state ok miod@ otto@
-rw-r--r--lib/librthread/rthread_sem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/librthread/rthread_sem.c b/lib/librthread/rthread_sem.c
index 66c22af4b9a..3a410b62155 100644
--- a/lib/librthread/rthread_sem.c
+++ b/lib/librthread/rthread_sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_sem.c,v 1.4 2012/01/17 02:34:18 guenther Exp $ */
+/* $OpenBSD: rthread_sem.c,v 1.5 2012/03/02 08:07:43 guenther Exp $ */
/*
* Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -92,6 +92,7 @@ sem_init(sem_t *semp, int pshared, unsigned int value)
errno = ENOSPC;
return (-1);
}
+ sem->lock = _SPINLOCK_UNLOCKED;
sem->value = value;
*semp = sem;