The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02703de8bcae3b45e6d96e8467d5fa512d62cc3d
commit 02703de8bcae3b45e6d96e8467d5fa512d62cc3d Author: Konstantin Belousov <k...@freebsd.org> AuthorDate: 2025-01-14 23:32:06 +0000 Commit: Konstantin Belousov <k...@freebsd.org> CommitDate: 2025-01-14 23:35:38 +0000 pthread_create(): style Use NULL instead of 0 for null pointer. Use != 0 for non-bool, as in the rest of the function. Remove unneeded (). Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_create.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 4de9bd84ca5b..2ae7cf0cd7b2 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -146,7 +146,7 @@ _pthread_create(pthread_t * __restrict thread, _thr_stack_fix_protection(new_thread); /* Return thread pointer eariler so that new thread can use it. */ - (*thread) = new_thread; + *thread = new_thread; if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { THR_THREAD_LOCK(curthread, new_thread); locked = 1; @@ -226,8 +226,8 @@ _pthread_create(pthread_t * __restrict thread, THR_THREAD_UNLOCK(curthread, new_thread); } out: - if (ret) - (*thread) = 0; + if (ret != 0) + *thread = NULL; return (ret); }