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:
parent
6aea13e229
commit
cd0fb6dcc8
Notes:
sideshowbarker
2024-07-17 08:46:27 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/cd0fb6dcc8 Pull-request: https://github.com/SerenityOS/serenity/pull/14539 Reviewed-by: https://github.com/ADKaster
1 changed files with 2 additions and 2 deletions
|
@ -29,11 +29,11 @@ StackInfo::StackInfo()
|
||||||
int rc;
|
int rc;
|
||||||
pthread_attr_t attr = {};
|
pthread_attr_t attr = {};
|
||||||
if ((rc = pthread_getattr_np(pthread_self(), &attr)) != 0) {
|
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();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
if ((rc = pthread_attr_getstack(&attr, (void**)&m_base, &m_size)) != 0) {
|
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();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue