[v1,6/6] nptl: mutex-test9: Include CLOCK_MONOTONIC for PI

Message ID 20210625081104.1134598-7-kurt@linutronix.de
State Superseded
Headers
Series nptl: Introduce and use FUTEX_LOCK_PI2 |

Commit Message

Kurt Kanzenbach June 25, 2021, 8:11 a.m. UTC
  pthread_mutex_clocklock(MONOTONIC)/PI is now supported.

Adjust the test accordingly.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 sysdeps/pthread/tst-mutex9.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Patch

diff --git a/sysdeps/pthread/tst-mutex9.c b/sysdeps/pthread/tst-mutex9.c
index 58c3a1aec263..d53eda841551 100644
--- a/sysdeps/pthread/tst-mutex9.c
+++ b/sysdeps/pthread/tst-mutex9.c
@@ -114,7 +114,12 @@  do_test_clock (clockid_t clockid)
       if (clockid == CLOCK_USE_TIMEDLOCK)
         TEST_COMPARE (pthread_mutex_timedlock (m, &ts), ETIMEDOUT);
       else
-        TEST_COMPARE (pthread_mutex_clocklock (m, clockid, &ts), ETIMEDOUT);
+	{
+	  int err = pthread_mutex_clocklock (m, clockid, &ts);
+
+	  TEST_VERIFY (err == ETIMEDOUT ||
+		       (clockid == CLOCK_MONOTONIC && err == EINVAL));
+	}
 
       alarm (1);
 
@@ -144,9 +149,7 @@  do_test (void)
 
   do_test_clock (CLOCK_USE_TIMEDLOCK);
   do_test_clock (CLOCK_REALTIME);
-#ifndef ENABLE_PI
   do_test_clock (CLOCK_MONOTONIC);
-#endif
   return 0;
 }