Skip to content

Commit

Permalink
output the correct error when set_thread_name fails
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd committed Oct 30, 2024
1 parent 62450f9 commit 5375f8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/quill/backend/BackendUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ QUILL_ATTRIBUTE_COLD inline void set_thread_name(char const* name)
auto const res = pthread_setname_np(name);
if (res != 0)
{
QUILL_THROW(QuillError{std::string{"Failed to set thread name - errno: " + std::to_string(errno) +
" error: " + strerror(errno)}});
QUILL_THROW(QuillError{std::string{"Failed to set thread name - error: " + std::to_string(res) +
" error: " + strerror(res)}});
}
#else
// linux
Expand All @@ -134,8 +134,8 @@ QUILL_ATTRIBUTE_COLD inline void set_thread_name(char const* name)
auto const res = pthread_setname_np(pthread_self(), name);
if (res != 0)
{
QUILL_THROW(QuillError{std::string{"Failed to set thread name - errno: " + std::to_string(errno) +
" error: " + strerror(errno)}});
QUILL_THROW(QuillError{std::string{"Failed to set thread name - error: " + std::to_string(res) +
" error: " + strerror(res)}});
}
#endif
}
Expand Down

0 comments on commit 5375f8f

Please sign in to comment.