You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rm...@apache.org on 2021/08/21 02:33:53 UTC
[logging-log4cxx] 02/02: Fix pthread name test for linux
This is an automated email from the ASF dual-hosted git repository.
rmiddleton pushed a commit to branch LOGCXX-431
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 3687a8b253a196786b45b506b03399fc530fecd9
Author: Robert Middleton <ro...@rm5248.com>
AuthorDate: Fri Aug 20 22:33:44 2021 -0400
Fix pthread name test for linux
---
src/cmake/pthread/log4cxx-pthread.cmake | 3 ++-
src/cmake/pthread/test-pthread.cpp | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/cmake/pthread/log4cxx-pthread.cmake b/src/cmake/pthread/log4cxx-pthread.cmake
index aa3647b..d4a5272 100644
--- a/src/cmake/pthread/log4cxx-pthread.cmake
+++ b/src/cmake/pthread/log4cxx-pthread.cmake
@@ -1,5 +1,6 @@
include(FindThreads)
try_compile(PTHREAD_SETNAME_NP_FOUND "${CMAKE_BINARY_DIR}/pthread-compile-tests"
- "${CMAKE_CURRENT_LIST_DIR}/test-pthread.cpp")
+ "${CMAKE_CURRENT_LIST_DIR}/test-pthread.cpp"
+ LINK_LIBRARIES Threads::Threads )
diff --git a/src/cmake/pthread/test-pthread.cpp b/src/cmake/pthread/test-pthread.cpp
index f30cd1a..73f453c 100644
--- a/src/cmake/pthread/test-pthread.cpp
+++ b/src/cmake/pthread/test-pthread.cpp
@@ -2,5 +2,5 @@
int main(){
pthread_t tid;
- pthread_set_name_np(tid, "name");
+ pthread_setname_np(tid, "name");
}