common: fix return value check for setpriority (#18412)
* common: fix return value check for setpriority * tools: add logging for process priority setting
This commit is contained in:
parent
e70e640db3
commit
daa242dfc8
3 changed files with 9 additions and 3 deletions
|
|
@ -251,7 +251,7 @@ bool set_process_priority(enum ggml_sched_priority prio) {
|
|||
case GGML_SCHED_PRIO_REALTIME: p = -20; break;
|
||||
}
|
||||
|
||||
if (!setpriority(PRIO_PROCESS, 0, p)) {
|
||||
if (setpriority(PRIO_PROCESS, 0, p) != 0) {
|
||||
LOG_WRN("failed to set process priority %d : %s (%d)\n", prio, strerror(errno), errno);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue