diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-06 18:49:28 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-04-06 18:49:28 +0200 |
commit | 87fb72032e6aa6abe5ac8fb05d22f43e8dde557b (patch) | |
tree | 888f3ebc60d40231ac79d12b5d40483ccb337f77 | |
parent | 6dbbac5d4fbe1bd84f5dae4a271b4934a366d199 (diff) | |
download | busybox-w32-87fb72032e6aa6abe5ac8fb05d22f43e8dde557b.tar.gz busybox-w32-87fb72032e6aa6abe5ac8fb05d22f43e8dde557b.tar.bz2 busybox-w32-87fb72032e6aa6abe5ac8fb05d22f43e8dde557b.zip |
init: clear utmp entries for dead processes, if they (entries) exist
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | init/init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c index b9c892407..481f55167 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -15,6 +15,9 @@ | |||
15 | #include <sys/reboot.h> | 15 | #include <sys/reboot.h> |
16 | #include <sys/resource.h> | 16 | #include <sys/resource.h> |
17 | #include <linux/vt.h> | 17 | #include <linux/vt.h> |
18 | #if ENABLE_FEATURE_UTMP | ||
19 | # include <utmp.h> /* DEAD_PROCESS */ | ||
20 | #endif | ||
18 | 21 | ||
19 | 22 | ||
20 | /* Was a CONFIG_xxx option. A lot of people were building | 23 | /* Was a CONFIG_xxx option. A lot of people were building |
@@ -415,6 +418,7 @@ static struct init_action *mark_terminated(pid_t pid) | |||
415 | return a; | 418 | return a; |
416 | } | 419 | } |
417 | } | 420 | } |
421 | update_utmp(pid, DEAD_PROCESS, /*tty_name:*/ NULL, /*username:*/ NULL, /*hostname:*/ NULL); | ||
418 | } | 422 | } |
419 | return NULL; | 423 | return NULL; |
420 | } | 424 | } |