--- a/tests/cancel2.c
+++ b/tests/cancel2.c
@@ -167,7 +167,7 @@
   int i;
   pthread_t t[NUMTHREADS + 1];
 
-  assert((t[0] = pthread_self()) != NULL);
+  assert((t[0] = pthread_self()).p != NULL);
   assert(pthread_mutex_lock(&waitLock) == 0);
 
   for (i = 1; i <= NUMTHREADS; i++)