about summary refs log tree commit diff
path: root/sysdeps/pthread/tst-thrd-sleep.c
diff options
context:
space:
mode:
authorCorinna Vinschen <vinschen@redhat.com>2020-09-07 11:42:51 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-09-07 11:42:52 +0200
commit7b51d9f69e742d29b335f4ced07ed0f191b12f82 (patch)
treea42fe47df30dd247566a256e8b5da071d551accf /sysdeps/pthread/tst-thrd-sleep.c
parent721a853415e358ba887c9fc693899cb648ca79f3 (diff)
downloadglibc-7b51d9f69e742d29b335f4ced07ed0f191b12f82.tar.gz
glibc-7b51d9f69e742d29b335f4ced07ed0f191b12f82.tar.xz
glibc-7b51d9f69e742d29b335f4ced07ed0f191b12f82.zip
C11 threads: Fix inaccuracies in testsuite
- tst-mtx-recursive.c: mtx_init fails to use mtx_plain.  Per C11
  specs, using mtx_recursive alone is not supported.  This isn't
  catched because mtx_plain is defined as 0.

- tst-thrd-sleep.c: thrd_sleep returns 0 on success, a negative
  value on failure.  Testing against thrd_success is incorrect.

- tst-tss-basic.c: tss_set is incorrectly checkd for a non-0
  value.  The test should test aginst C11 threads error codes.
  This isn't catched because thrd_success is defined as 0.

Note that all three tests fail on FreeBSD, which defines all mutex type
values, as well as all C11 threads error codes with non-0 values.
Diffstat (limited to 'sysdeps/pthread/tst-thrd-sleep.c')
-rw-r--r--sysdeps/pthread/tst-thrd-sleep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/pthread/tst-thrd-sleep.c b/sysdeps/pthread/tst-thrd-sleep.c
index 39d5fc7079..8cc4bb2690 100644
--- a/sysdeps/pthread/tst-thrd-sleep.c
+++ b/sysdeps/pthread/tst-thrd-sleep.c
@@ -27,7 +27,7 @@ static int
 sleep_thrd (void *arg)
 {
   struct timespec const *tl = (struct timespec const *) arg;
-  if (thrd_sleep (tl, NULL) != thrd_success)
+  if (thrd_sleep (tl, NULL) != 0)
     FAIL_EXIT1 ("thrd_sleep failed");
 
   thrd_exit (thrd_success);