Skip to content

Commit

Permalink
init: utmp update of DEAD_PROCESS was misplaced, and could be skipped…
Browse files Browse the repository at this point in the history
…. Fixing.

Signed-off-by: Denys Vlasenko <[email protected]>
  • Loading branch information
Denys Vlasenko committed Dec 5, 2011
1 parent 0fa3e5f commit beb860a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,17 @@ 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
);
for (a = init_action_list; a; a = a->next) {
if (a->pid == pid) {
a->pid = 0;
return a;
}
}
update_utmp(pid, DEAD_PROCESS, /*tty_name:*/ NULL,
/*username:*/ NULL,
/*hostname:*/ NULL);
}
return NULL;
}
Expand Down

0 comments on commit beb860a

Please sign in to comment.