diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-01-05 15:37:58 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-01-05 15:37:58 +0100 |
commit | da9212667c99f2f2121747c4715d067deb7c155b (patch) | |
tree | 66a670e6d78ca899a454a42228abbbc2740fad0d /libbb | |
parent | 08b90a9d10f2f712c6e16c118328d85930762b92 (diff) | |
download | busybox-w32-da9212667c99f2f2121747c4715d067deb7c155b.tar.gz busybox-w32-da9212667c99f2f2121747c4715d067deb7c155b.tar.bz2 busybox-w32-da9212667c99f2f2121747c4715d067deb7c155b.zip |
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>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/utmp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libbb/utmp.c b/libbb/utmp.c index 09443fb6c..8ad9ba27e 100644 --- a/libbb/utmp.c +++ b/libbb/utmp.c | |||
@@ -130,3 +130,17 @@ void FAST_FUNC update_utmp(pid_t pid, int new_type, const char *tty_name, const | |||
130 | updwtmp(bb_path_wtmp_file, &utent); | 130 | updwtmp(bb_path_wtmp_file, &utent); |
131 | #endif | 131 | #endif |
132 | } | 132 | } |
133 | |||
134 | /* man utmp: | ||
135 | * When init(8) finds that a process has exited, it locates its utmp entry | ||
136 | * by ut_pid, sets ut_type to DEAD_PROCESS, and clears ut_user, ut_host | ||
137 | * and ut_time with null bytes. | ||
138 | * [same applies to other processes which maintain utmp entries, like telnetd] | ||
139 | * | ||
140 | * We do not bother actually clearing fields: | ||
141 | * it might be interesting to know who was logged in and from where | ||
142 | */ | ||
143 | void FAST_FUNC update_utmp_DEAD_PROCESS(pid_t pid) | ||
144 | { | ||
145 | update_utmp(pid, DEAD_PROCESS, NULL, NULL, NULL); | ||
146 | } | ||