This commit is contained in:
proller 2018-08-23 21:39:21 +03:00
parent 380a472a8d
commit fe45a62c34

View File

@ -40,11 +40,11 @@ std::string getThreadName()
std::string name(16, '\0');
#if defined(__APPLE__)
if (pthread_getname_np(pthread_self(), name.data(), name.size()));
if (pthread_getname_np(pthread_self(), name.data(), name.size()))
throw DB::Exception("Cannot get thread name with pthread_getname_np()", DB::ErrorCodes::PTHREAD_ERROR);
#elif defined(__FreeBSD__)
// TODO: make test. freebsd will have this function soon https://freshbsd.org/commit/freebsd/r337983
// if (pthread_get_name_np(pthread_self(), name.data(), name.size()));
// if (pthread_get_name_np(pthread_self(), name.data(), name.size()))
// throw DB::Exception("Cannot get thread name with pthread_get_name_np()", DB::ErrorCodes::PTHREAD_ERROR);
#else
if (0 != prctl(PR_GET_NAME, name.data(), 0, 0, 0))