summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Src/exec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 7120a2c34..ecad923de 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2789,8 +2789,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc,
/* Check if we should run background jobs at a lower priority. */
if ((how & Z_ASYNC) && isset(BGNICE)) {
errno = 0;
- nice(5);
- if (errno)
+ if (nice(5) == -1 && errno)
zwarn("nice(5) failed: %e", errno);
}
#endif /* HAVE_NICE */