]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Clean up nptl/tst-join5 use of nanosleep.
authorRoland McGrath <roland@hack.frob.com>
Fri, 6 Feb 2015 20:21:38 +0000 (12:21 -0800)
committerRoland McGrath <roland@hack.frob.com>
Fri, 6 Feb 2015 20:21:38 +0000 (12:21 -0800)
ChangeLog
nptl/tst-join5.c

index 94a3907a27250ffdab08b465e74351fecac8a2e4..c28f7e542ed15ddd5d34a62c2f8702a9ffdc43c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-02-06  Roland McGrath  <roland@hack.frob.com>
 
+       * nptl/tst-join5.c: Drop #include <sys/syscall.h>.
+       (wait_code): New function replaces macro.
+       Call nanosleep rather than syscall.
+
        * nptl/pt-system.c: Rewritten.  Put everything under
        [SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)].
        Use IFUNC to redirect when possible.
index e83f8958c00f6f3ab5d4db3c55d5ed022edfc97e..b45d2106298beefda5816651ed4b4c2d45da324f 100644 (file)
 #include <stdlib.h>
 #include <time.h>
 #include <unistd.h>
-#include <sys/syscall.h>
 
 
-#define wait_code()                                                          \
-  do {                                                                       \
-    struct timespec ts = { .tv_sec = 0, .tv_nsec = 200000000 };                      \
-    while (syscall (__NR_nanosleep, &ts, &ts) < 0)                           \
-      /* nothing */;                                                         \
-  } while (0)
+static void
+wait_code (void)
+{
+  struct timespec ts = { .tv_sec = 0, .tv_nsec = 200000000 };
+  while (nanosleep (&ts, &ts) < 0)
+    ;
+}
 
 
 #ifdef WAIT_IN_CHILD