Skip to content

Fix error reporting for POSIX Threads functions

Commit 3608abc8 inadvertently carried over a mistake in logging pthread_cond_init() errors to the ERRNO_CHECK() preprocessor macro: instead of passing the value returned by a given pthread_*() function to strerror_r(), ERRNO_CHECK() passes the errno variable to strerror_r(). This causes bogus error reports because POSIX Threads API functions do not set the errno variable.

Fix by passing the value returned by a given pthread_*() function instead of the errno variable to strerror_r(). Since this change makes the name of the affected macro (ERRNO_CHECK()) confusing, rename the latter to PTHREADS_RUNTIME_CHECK(). Also log the integer error value returned by a given pthread_*() function verbatim to rule out any further confusion in runtime error reporting.

See #3534 (closed)

Edited by Michał Kępień

Merge request reports