AK: Do not negate Pthread error codes for strerror()

On all systems I've checked, pthread functions return the positive error
code directly.
This commit is contained in:
Daniel Bertalan 2022-07-10 15:10:20 +02:00 committed by Andreas Kling
parent 6aea13e229
commit cd0fb6dcc8
Notes: sideshowbarker 2024-07-17 08:46:27 +09:00

View file

@ -29,11 +29,11 @@ StackInfo::StackInfo()
int rc;
pthread_attr_t attr = {};
if ((rc = pthread_getattr_np(pthread_self(), &attr)) != 0) {
fprintf(stderr, "pthread_getattr_np: %s\n", strerror(-rc));
fprintf(stderr, "pthread_getattr_np: %s\n", strerror(rc));
VERIFY_NOT_REACHED();
}
if ((rc = pthread_attr_getstack(&attr, (void**)&m_base, &m_size)) != 0) {
fprintf(stderr, "pthread_attr_getstack: %s\n", strerror(-rc));
fprintf(stderr, "pthread_attr_getstack: %s\n", strerror(rc));
VERIFY_NOT_REACHED();
}
pthread_attr_destroy(&attr);