diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-02-26 11:47:52 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-02-26 11:47:52 +0000 |
commit | ded4b9ed121c2dfed155d516d59b0dff26b5b6f8 (patch) | |
tree | 425fc5856ec152fcee25ca9a3701a2504ea77f18 /regress/lib | |
parent | 74955f8ea2a58aeef9ad79a3847b865cd841262c (diff) |
Let this compile with gcc 2.
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c b/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c index f5e77b27881..93f399e5476 100644 --- a/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c +++ b/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread_rwlock.c,v 1.1 2012/02/20 04:08:52 guenther Exp $ */ +/* $OpenBSD: pthread_rwlock.c,v 1.2 2012/02/26 11:47:51 miod Exp $ */ /* PUBLIC DOMAIN Feb 2012 <guenther@openbsd.org> */ #include <sys/types.h> @@ -35,6 +35,7 @@ static void * reader(void *arg) { int me = *(int *)arg; + int diff; pthread_mutex_lock(&m); assert(state < NUM_READERS); @@ -50,7 +51,7 @@ reader(void *arg) printf("reader %d woken, state = %d\n", me, state); } - int diff = difftime(time(NULL), write_started); + diff = difftime(time(NULL), write_started); if (diff < 2) sleep(3 - diff); |