diff options
author | 2012-03-03 09:36:26 +0000 | |
---|---|---|
committer | 2012-03-03 09:36:26 +0000 | |
commit | ce8a7339e20e3e13b3dadd581f8977d7576826a1 (patch) | |
tree | 9bec128e5ce1e7b7c15a78ce644e1bd697903fac /regress/lib/libpthread/semaphore/sem_getvalue | |
parent | The wlmouse offset should be part of the client, not the server. From (diff) | |
download | wireguard-openbsd-ce8a7339e20e3e13b3dadd581f8977d7576826a1.tar.xz wireguard-openbsd-ce8a7339e20e3e13b3dadd581f8977d7576826a1.zip |
While we guarantee that a zero-filled sem_t variable will trigger
EINVAL errors, a sem_t on the stack may have garbage, so make the
tests portable by moving the sem_t from function to file scope.
problem found by miod@
Diffstat (limited to 'regress/lib/libpthread/semaphore/sem_getvalue')
-rw-r--r-- | regress/lib/libpthread/semaphore/sem_getvalue/sem_getvalue.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/regress/lib/libpthread/semaphore/sem_getvalue/sem_getvalue.c b/regress/lib/libpthread/semaphore/sem_getvalue/sem_getvalue.c index 354f6ac6c44..19e596f90f7 100644 --- a/regress/lib/libpthread/semaphore/sem_getvalue/sem_getvalue.c +++ b/regress/lib/libpthread/semaphore/sem_getvalue/sem_getvalue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sem_getvalue.c,v 1.1.1.1 2012/01/04 17:36:40 mpi Exp $ */ +/* $OpenBSD: sem_getvalue.c,v 1.2 2012/03/03 09:36:26 guenther Exp $ */ /* * Martin Pieuchot <mpi@openbsd.org>, 2011. Public Domain. */ @@ -7,10 +7,11 @@ #include <semaphore.h> #include "test.h" +sem_t sem; + int main(int argc, char **argv) { - sem_t sem; int val; CHECKr(sem_init(&sem, 0, 0)); |