From 4b700a4857186e878d6b3500d216f88085f2ecd5 Mon Sep 17 00:00:00 2001 From: cgf Date: Wed, 24 Dec 2003 04:37:19 +0000 Subject: [PATCH] * winsup.api/pthread/rwlock7.c (main): Don't assume that result of rand operation is non-zero. --- winsup/testsuite/ChangeLog | 5 +++++ winsup/testsuite/winsup.api/pthread/rwlock7.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog index 353bfb00e2..ec19bca954 100644 --- a/winsup/testsuite/ChangeLog +++ b/winsup/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-12-23 Christopher Faylor + + * winsup.api/pthread/rwlock7.c (main): Don't assume that result of rand + operation is non-zero. + 2003-12-01 Corinna Vinschen * 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 5b0727d994..ded882d9f6 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); -- 2.11.0