util: make ScheduleBatchPriority advisory only

This commit is contained in:
fanquake
2019-11-25 17:31:31 -05:00
parent 0ee914ba9e
commit d2a3a5cadb
2 changed files with 3 additions and 9 deletions

View File

@@ -1126,17 +1126,13 @@ fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
return fs::absolute(path, GetDataDir(net_specific));
}
int ScheduleBatchPriority()
void ScheduleBatchPriority()
{
#ifdef SCHED_BATCH
const static sched_param param{};
if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
if (pthread_setschedparam(pthread_self(), SCHED_BATCH, &param) != 0) {
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
return ret;
}
return 0;
#else
return 1;
#endif
}