mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-07 23:33:55 +00:00
Fixups to nice handling. Users can't normally lower niceness.
This commit is contained in:
parent
02a7bdc6c4
commit
9b20563ef5
3 changed files with 26 additions and 12 deletions
13
stream.c
13
stream.c
|
|
@ -1276,9 +1276,10 @@ static void *compthread(void *data)
|
|||
cti = &cthread[i];
|
||||
ctis = cti->sinfo;
|
||||
|
||||
if (unlikely(setpriority(PRIO_PROCESS, 0, control->nice_val) == -1))
|
||||
print_err("Warning, unable to set nice value on thread\n");
|
||||
|
||||
if (unlikely(setpriority(PRIO_PROCESS, 0, control->nice_val) == -1)) {
|
||||
print_err("Warning, unable to set thread nice value %d...Resetting to %d\n", control->nice_val, current_priority);
|
||||
setpriority(PRIO_PROCESS, 0, (control->nice_val=current_priority));
|
||||
}
|
||||
cti->c_type = CTYPE_NONE;
|
||||
cti->c_len = cti->s_len;
|
||||
|
||||
|
|
@ -1512,8 +1513,10 @@ static void *ucompthread(void *data)
|
|||
dealloc(data);
|
||||
uci = &ucthread[i];
|
||||
|
||||
if (unlikely(setpriority(PRIO_PROCESS, 0, control->nice_val) == -1))
|
||||
print_err("Warning, unable to set nice value on thread\n");
|
||||
if (unlikely(setpriority(PRIO_PROCESS, 0, control->nice_val) == -1)) {
|
||||
print_err("Warning, unable to set thread nice value %d...Resetting to %d\n", control->nice_val, current_priority);
|
||||
setpriority(PRIO_PROCESS, 0, (control->nice_val=current_priority));
|
||||
}
|
||||
|
||||
retry:
|
||||
if (uci->c_type != CTYPE_NONE) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue