Skip to content

Commit ba96bbc

Browse files
authored
Do not fail if niceness syscall is blocked (#19)
1 parent 894ab67 commit ba96bbc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

localexec_unix.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@ func (l LocalExecer) Start(ctx context.Context, c Command) (Process, error) {
9696
if l.ChildProcessPriority != nil {
9797
pid := process.cmd.Process.Pid
9898
niceness := *l.ChildProcessPriority
99-
err := syscall.Setpriority(syscall.PRIO_PROCESS, pid, niceness)
100-
if err != nil {
101-
return nil, xerrors.Errorf("set process (pid: %d) priority to (niceness: %d): %w", pid, niceness, err)
102-
}
99+
100+
// the environment may block the niceness syscall
101+
_ = syscall.Setpriority(syscall.PRIO_PROCESS, pid, niceness)
103102
}
104103

105104
return &process, nil

0 commit comments

Comments
 (0)