From 59901e61cb3e7c8c36bb77c722102e2b9504dc5c Mon Sep 17 00:00:00 2001 From: "_RuRo_ (Андрей Стоцкий)" Date: Wed, 16 Oct 2019 19:26:06 +0300 Subject: 44841: Better checking of errors from "nice" --- Src/exec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index e81053d67..6014ec9a5 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -2765,9 +2765,12 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, sigtrapped[SIGEXIT] = 0; #ifdef HAVE_NICE /* Check if we should run background jobs at a lower priority. */ - if ((how & Z_ASYNC) && isset(BGNICE)) - if (nice(5) < 0) + if ((how & Z_ASYNC) && isset(BGNICE)) { + errno = 0; + nice(5); + if (errno) zwarn("nice(5) failed: %e", errno); + } #endif /* HAVE_NICE */ return 0; -- cgit 1.4.1