libbb: code shrink by factoring out common update_utmp_DEAD_PROCESS

function                                             old     new   delta
update_utmp_DEAD_PROCESS                               -      17     +17
telnetd_main                                        1685    1674     -11
mark_terminated                                       56      45     -11
handle_sigchld                                        74      63     -11

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2015-01-05 15:37:58 +01:00
parent 08b90a9d10
commit da9212667c
5 changed files with 20 additions and 16 deletions

View File

@@ -538,11 +538,7 @@ static struct init_action *mark_terminated(pid_t pid)
struct init_action *a;
if (pid > 0) {
update_utmp(pid, DEAD_PROCESS,
/*tty_name:*/ NULL,
/*username:*/ NULL,
/*hostname:*/ NULL
);
update_utmp_DEAD_PROCESS(pid);
for (a = init_action_list; a; a = a->next) {
if (a->pid == pid) {
a->pid = 0;