pthread: do not error from pthread_condattr_setclock dummy

Do not regard a fake condattr object produced by pthread_condattr_init
as invalid when passed to no-op dummies.

Fix #2471
This commit is contained in:
Emery Hemingway 2017-08-03 09:44:17 -05:00 committed by Christian Helmuth
parent ad6c94bb09
commit 2d8bfd8569
1 changed files with 5 additions and 5 deletions

View File

@ -537,7 +537,7 @@ extern "C" {
if (!attr)
return EINVAL;
*attr = 0;
*attr = nullptr;
return 0;
}
@ -545,11 +545,10 @@ extern "C" {
int pthread_condattr_destroy(pthread_condattr_t *attr)
{
if (!attr || !*attr)
/* assert that the attr was produced by the init no-op */
if (!attr || *attr != nullptr)
return EINVAL;
warning(__func__, " not implemented yet");
return 0;
}
@ -557,7 +556,8 @@ extern "C" {
int pthread_condattr_setclock(pthread_condattr_t *attr,
clockid_t clock_id)
{
if (!attr || !*attr)
/* assert that the attr was produced by the init no-op */
if (!attr || *attr != nullptr)
return EINVAL;
warning(__func__, " not implemented yet");