diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-08-15 11:06:35 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-08-17 05:02:06 -0700 |
commit | cb7e7a5ca1d6d25d59bc038bdc09630e507c41e5 (patch) | |
tree | 9469d86a481126df10823303d8a386d1077d238e /nptl/pthread_timedjoin.c | |
parent | 23a7896d065a99057c06a1bd22c2bbee175b0ae4 (diff) | |
download | glibc-cb7e7a5ca1d6d25d59bc038bdc09630e507c41e5.tar.gz glibc-cb7e7a5ca1d6d25d59bc038bdc09630e507c41e5.tar.xz glibc-cb7e7a5ca1d6d25d59bc038bdc09630e507c41e5.zip |
nptl: Handle NULL abstime [BZ #26394]
Since abstime passed to pthread_{clock|timed}join_np may be NULL, convert to 64 bit abstime only if abstime isn't NULL.
Diffstat (limited to 'nptl/pthread_timedjoin.c')
-rw-r--r-- | nptl/pthread_timedjoin.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c index 6164ae7060..6ade58853c 100644 --- a/nptl/pthread_timedjoin.c +++ b/nptl/pthread_timedjoin.c @@ -34,9 +34,13 @@ int __pthread_timedjoin_np (pthread_t threadid, void **thread_return, const struct timespec *abstime) { - struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime); - - return __pthread_timedjoin_np64 (threadid, thread_return, &ts64); + if (abstime != NULL) + { + struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime); + return __pthread_timedjoin_np64 (threadid, thread_return, &ts64); + } + else + return __pthread_timedjoin_np64 (threadid, thread_return, NULL); } #endif weak_alias (__pthread_timedjoin_np, pthread_timedjoin_np) |