From: Tobias Stoeckmann Date: Fri, 9 Jan 2026 16:32:37 +0000 (+0100) Subject: su: Remove dead code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb31772d7fb6293850fce60a73072d80d9f93616;p=thirdparty%2Fshadow.git su: Remove dead code The pid_child is never 0 when reaching kill_child, since kill_child is called within an if-block which checks explicitly for pid_child not being 0. Reviewed-by: Alejandro Colomar Reviewed-by: Ruihan Li Signed-off-by: Tobias Stoeckmann --- diff --git a/src/su.c b/src/su.c index 5e8033aba..15add1c55 100644 --- a/src/su.c +++ b/src/su.c @@ -169,12 +169,8 @@ static bool iswheel (const char *username) static void kill_child(pid_t pid_child) { - if (0 != pid_child) { - (void) kill (-pid_child, SIGKILL); - fputs(_(" ...killed.\n"), stderr); - } else { - fputs(_(" ...waiting for child to terminate.\n"), stderr); - } + kill(-pid_child, SIGKILL); + fputs(_(" ...killed.\n"), stderr); _exit (255); }