aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-05-18 16:59:56 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-05-18 16:59:56 -0300
commit3f500e7202476500fdc70f98d796d4103705638f (patch)
tree8f9c20b2ec7e55fa0c1008b46e48e092b55a9a66
parent8382f4c3e5daf28af1aba0743aa3d62c7490bbf3 (diff)
downloadglibc-3f500e7202476500fdc70f98d796d4103705638f.zip
glibc-3f500e7202476500fdc70f98d796d4103705638f.tar.gz
glibc-3f500e7202476500fdc70f98d796d4103705638f.tar.bz2
linux: Fix clock_getres fallback
The tst-timespec_getres (e5ac7bd679de5) triggers an issue on 32-bit architecture on Linux older than 5.1, where the fallback syscall is used. Checked on powerpc-linux-gnu.
-rw-r--r--sysdeps/unix/sysv/linux/clock_getres.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/clock_getres.c b/sysdeps/unix/sysv/linux/clock_getres.c
index d560cd7..a9edec9 100644
--- a/sysdeps/unix/sysv/linux/clock_getres.c
+++ b/sysdeps/unix/sysv/linux/clock_getres.c
@@ -56,7 +56,7 @@ __clock_getres64 (clockid_t clock_id, struct __timespec64 *res)
# else
r = INLINE_SYSCALL_CALL (clock_getres, clock_id, &ts32);
# endif
- if (r == 0)
+ if (r == 0 && res != NULL)
*res = valid_timespec_to_timespec64 (ts32);
#endif