fix malloc-brk-fail
[libc-test] / src / regression / pthread_cond-smasher.c
index a1ea918..337289b 100644 (file)
@@ -73,8 +73,12 @@ static unsigned volatile phase;
 static void settimeout(struct timespec *ts)
 {
   if (clock_gettime(CLOCK_REALTIME, ts))
-    t_error("clock_gettime failed: %s\n", errorstring(errno));
+    t_error("clock_gettime failed: %s\n", strerror(errno));
   ts->tv_nsec += 500*1000*1000;
+  if (ts->tv_nsec >= 1000*1000*1000) {
+    ts->tv_nsec -= 1000*1000*1000;
+    ts->tv_sec++;
+  }
 }
 
 static thread_ret client(void *arg) {