]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
su: Use exit instead of _exit in kill_child
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 9 Jan 2026 16:49:39 +0000 (17:49 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sun, 11 Jan 2026 14:46:59 +0000 (15:46 +0100)
Since this is no signal handler anymore, allow regular exit routine to
flush stderr etc.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Ruihan Li <lrh2000@pku.edu.cn>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
src/su.c

index 7cf203b50a7ff1920c5919a6a7175920038cbd9e..dfbfc3c573b51e1669286390f1fc1bf1c5ce8d3a 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -172,7 +172,7 @@ kill_child(pid_t pid_child)
 {
        kill(-pid_child, SIGKILL);
        fputs(_(" ...killed.\n"), stderr);
-       _exit (255);
+       exit (255);
 }
 
 static void
@@ -402,7 +402,7 @@ static void prepare_pam_close_session (void)
                if (sigprocmask (SIG_BLOCK, &ourset, NULL) != 0) {
                        fprintf (stderr, _("%s: signal masking malfunction\n"), Prog);
                        kill_child(pid_child);
-                       /* Never reached (_exit called). */
+                       /* Never reached (exit called). */
                }
 
                /* Send SIGKILL to the child if it doesn't
@@ -418,7 +418,7 @@ static void prepare_pam_close_session (void)
                        sigsuspend (&ourset);
                        if (timeout) {
                                kill_child(pid_child);
-                               /* Never reached (_exit called). */
+                               /* Never reached (exit called). */
                        }
                }
                pid_child = 0;