diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-13 17:26:21 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-13 17:26:21 +0000 |
commit | 05c8c4f745831f6f18e312f9ccc22bfbf2e8a605 (patch) | |
tree | 7032b40dabd7710b9eb35f50277df49d802a9416 /coreutils | |
parent | 72cc9641f80b6981cc97fd66feb8d5842ea5ed03 (diff) | |
download | busybox-w32-05c8c4f745831f6f18e312f9ccc22bfbf2e8a605.tar.gz busybox-w32-05c8c4f745831f6f18e312f9ccc22bfbf2e8a605.tar.bz2 busybox-w32-05c8c4f745831f6f18e312f9ccc22bfbf2e8a605.zip |
who: code shrink by Tito <farmatito@tiscali.it>
function old new delta
who_main 271 259 -12
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/who.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/coreutils/who.c b/coreutils/who.c index 75bb72456..725974425 100644 --- a/coreutils/who.c +++ b/coreutils/who.c | |||
@@ -55,8 +55,6 @@ int who_main(int argc, char **argv) | |||
55 | printf("USER TTY IDLE TIME HOST\n"); | 55 | printf("USER TTY IDLE TIME HOST\n"); |
56 | while ((ut = getutent()) != NULL) { | 56 | while ((ut = getutent()) != NULL) { |
57 | if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) { | 57 | if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) { |
58 | time_t thyme = ut->ut_tv.tv_sec; | ||
59 | |||
60 | /* ut->ut_line is device name of tty - "/dev/" */ | 58 | /* ut->ut_line is device name of tty - "/dev/" */ |
61 | name = concat_path_file("/dev", ut->ut_line); | 59 | name = concat_path_file("/dev", ut->ut_line); |
62 | str6[0] = '?'; | 60 | str6[0] = '?'; |
@@ -66,7 +64,7 @@ int who_main(int argc, char **argv) | |||
66 | /* 15 chars for time: Nov 10 19:33:20 */ | 64 | /* 15 chars for time: Nov 10 19:33:20 */ |
67 | printf("%-10s %-8s %-9s %-15.15s %s\n", | 65 | printf("%-10s %-8s %-9s %-15.15s %s\n", |
68 | ut->ut_user, ut->ut_line, str6, | 66 | ut->ut_user, ut->ut_line, str6, |
69 | ctime(&thyme) + 4, ut->ut_host); | 67 | ctime(&(ut->ut_tv.tv_sec)) + 4, ut->ut_host); |
70 | if (ENABLE_FEATURE_CLEAN_UP) | 68 | if (ENABLE_FEATURE_CLEAN_UP) |
71 | free(name); | 69 | free(name); |
72 | } | 70 | } |