From 41e318727e6fdca70b28431a10a60a73aa6f43bf Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Mon, 27 Jul 2020 14:56:09 +0200 Subject: 46268: suppress a useless compiler warning around nice() From nice(2): To detect an error, set errno to 0 before the call, and check whether it is nonzero after nice() returns -1. --- Src/exec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Src/exec.c') 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 */ -- cgit v1.2.3