[git commit master] init: clear utmp entries for dead processes, if they (entries) exist

Denys Vlasenko vda.linux at googlemail.com
Tue Apr 6 16:50:05 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=87fb72032e6aa6abe5ac8fb05d22f43e8dde557b
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 init/init.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/init/init.c b/init/init.c
index b9c8924..481f551 100644
--- a/init/init.c
+++ b/init/init.c
@@ -15,6 +15,9 @@
 #include <sys/reboot.h>
 #include <sys/resource.h>
 #include <linux/vt.h>
+#if ENABLE_FEATURE_UTMP
+# include <utmp.h> /* DEAD_PROCESS */
+#endif
 
 
 /* Was a CONFIG_xxx option. A lot of people were building
@@ -415,6 +418,7 @@ static struct init_action *mark_terminated(pid_t pid)
 				return a;
 			}
 		}
+		update_utmp(pid, DEAD_PROCESS, /*tty_name:*/ NULL, /*username:*/ NULL, /*hostname:*/ NULL);
 	}
 	return NULL;
 }
-- 
1.6.3.3



More information about the busybox-cvs mailing list