aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-24 04:37:19 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-24 04:37:19 +0000
commit1f32b7b382a5a7600874b5d582220984afd460b6 (patch)
treeb70891d6d8e27303dd6634bace585b485083014b
parent05b2a10ba4187c46adef9c757e0bc01733fa06ec (diff)
downloadnewlib-1f32b7b382a5a7600874b5d582220984afd460b6.zip
newlib-1f32b7b382a5a7600874b5d582220984afd460b6.tar.gz
newlib-1f32b7b382a5a7600874b5d582220984afd460b6.tar.bz2
* winsup.api/pthread/rwlock7.c (main): Don't assume that result of rand
operation is non-zero.
-rw-r--r--winsup/testsuite/ChangeLog5
-rw-r--r--winsup/testsuite/winsup.api/pthread/rwlock7.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog
index 353bfb0..ec19bca 100644
--- a/winsup/testsuite/ChangeLog
+++ b/winsup/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-23 Christopher Faylor <cgf@redhat.com>
+
+ * winsup.api/pthread/rwlock7.c (main): Don't assume that result of rand
+ operation is non-zero.
+
2003-12-01 Corinna Vinschen <corinna@vinschen.de>
* winsup.api/known_bugs.tcl: Remove fcntl09 and fcntl10. These
diff --git a/winsup/testsuite/winsup.api/pthread/rwlock7.c b/winsup/testsuite/winsup.api/pthread/rwlock7.c
index 5b0727d..ded882d 100644
--- a/winsup/testsuite/winsup.api/pthread/rwlock7.c
+++ b/winsup/testsuite/winsup.api/pthread/rwlock7.c
@@ -141,7 +141,8 @@ main (int argc, char *argv[])
threads[count].thread_num = count;
threads[count].updates = 0;
threads[count].reads = 0;
- threads[count].interval = rand_r (&seed) % 71;
+ while (!(threads[count].interval = rand_r (&seed) % 71))
+ continue;
assert(pthread_create (&threads[count].thread_id,
NULL, thread_routine, (void*)&threads[count]) == 0);