diff --git a/repos/libports/src/lib/pthread/thread.cc b/repos/libports/src/lib/pthread/thread.cc index 2aced86e7d..2bda839fb3 100644 --- a/repos/libports/src/lib/pthread/thread.cc +++ b/repos/libports/src/lib/pthread/thread.cc @@ -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");