mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
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.
This commit is contained in:
@@ -33,10 +33,16 @@ libc_hidden_def (__pthread_clockjoin_np64)
|
|||||||
int
|
int
|
||||||
__pthread_clockjoin_np (pthread_t threadid, void **thread_return,
|
__pthread_clockjoin_np (pthread_t threadid, void **thread_return,
|
||||||
clockid_t clockid, const struct timespec *abstime)
|
clockid_t clockid, const struct timespec *abstime)
|
||||||
|
{
|
||||||
|
if (abstime != NULL)
|
||||||
{
|
{
|
||||||
struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
|
struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
|
||||||
|
return __pthread_clockjoin_np64 (threadid, thread_return, clockid,
|
||||||
return __pthread_clockjoin_np64 (threadid, thread_return, clockid, &ts64);
|
&ts64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return __pthread_clockjoin_np64 (threadid, thread_return, clockid,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
weak_alias (__pthread_clockjoin_np, pthread_clockjoin_np)
|
weak_alias (__pthread_clockjoin_np, pthread_clockjoin_np)
|
||||||
|
@@ -33,10 +33,14 @@ libc_hidden_def (__pthread_timedjoin_np64)
|
|||||||
int
|
int
|
||||||
__pthread_timedjoin_np (pthread_t threadid, void **thread_return,
|
__pthread_timedjoin_np (pthread_t threadid, void **thread_return,
|
||||||
const struct timespec *abstime)
|
const struct timespec *abstime)
|
||||||
|
{
|
||||||
|
if (abstime != NULL)
|
||||||
{
|
{
|
||||||
struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
|
struct __timespec64 ts64 = valid_timespec_to_timespec64 (*abstime);
|
||||||
|
|
||||||
return __pthread_timedjoin_np64 (threadid, thread_return, &ts64);
|
return __pthread_timedjoin_np64 (threadid, thread_return, &ts64);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return __pthread_timedjoin_np64 (threadid, thread_return, NULL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
weak_alias (__pthread_timedjoin_np, pthread_timedjoin_np)
|
weak_alias (__pthread_timedjoin_np, pthread_timedjoin_np)
|
||||||
|
Reference in New Issue
Block a user