aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Franke <christian.franke@t-online.de>2024-12-01 13:40:16 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2024-12-09 02:08:52 +0100
commite6f3a3b381fd32fc711b410aff9c9a37b75d353f (patch)
tree3cad56c2162be2eac5cf1b18d5952988d867646a
parent23db6896830d6b37fc3bcc3ad5a7f725eb97d2e1 (diff)
downloadbusybox-w32-e6f3a3b381fd32fc711b410aff9c9a37b75d353f.tar.gz
busybox-w32-e6f3a3b381fd32fc711b410aff9c9a37b75d353f.tar.bz2
busybox-w32-e6f3a3b381fd32fc711b410aff9c9a37b75d353f.zip
chpst: fix error check of nice(2) call
Check errno instead of return value because -1 is a valid return value also on success. Signed-off-by: Christian Franke <christian.franke@t-online.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--runit/chpst.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/runit/chpst.c b/runit/chpst.c
index 2be1a5775..4e3d613b7 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -466,7 +466,8 @@ int chpst_main(int argc UNUSED_PARAM, char **argv)
466 /* nice should be done before xsetuid */ 466 /* nice should be done before xsetuid */
467 if (opt & OPT_n) { 467 if (opt & OPT_n) {
468 errno = 0; 468 errno = 0;
469 if (nice(xatoi(nicestr)) == -1) 469 nice(xatoi(nicestr));
470 if (errno)
470 bb_simple_perror_msg_and_die("nice"); 471 bb_simple_perror_msg_and_die("nice");
471 } 472 }
472 473