about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/nanosleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/nanosleep.c')
-rw-r--r--sysdeps/unix/sysv/linux/nanosleep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/nanosleep.c b/sysdeps/unix/sysv/linux/nanosleep.c
index 8f4ee0f744..e58815c4d0 100644
--- a/sysdeps/unix/sysv/linux/nanosleep.c
+++ b/sysdeps/unix/sysv/linux/nanosleep.c
@@ -39,7 +39,7 @@ __nanosleep (const struct timespec *req, struct timespec *rem)
   struct __timespec64 treq64, trem64;
 
   treq64 = valid_timespec_to_timespec64 (*req);
-  int ret = __nanosleep64 (&treq64, &trem64);
+  int ret = __nanosleep64 (&treq64, rem != NULL ? &trem64 : NULL);
 
   if (ret != 0 && errno == EINTR && rem != NULL)
     *rem = valid_timespec64_to_timespec (trem64);