From 05c8c4f745831f6f18e312f9ccc22bfbf2e8a605 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 13 Nov 2007 17:26:21 +0000 Subject: [PATCH] who: code shrink by Tito function old new delta who_main 271 259 -12 --- coreutils/who.c | 4 +--- 1 file changed, 1 insertion(+), 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) printf("USER TTY IDLE TIME HOST\n"); while ((ut = getutent()) != NULL) { if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) { - time_t thyme = ut->ut_tv.tv_sec; - /* ut->ut_line is device name of tty - "/dev/" */ name = concat_path_file("/dev", ut->ut_line); str6[0] = '?'; @@ -66,7 +64,7 @@ int who_main(int argc, char **argv) /* 15 chars for time: Nov 10 19:33:20 */ printf("%-10s %-8s %-9s %-15.15s %s\n", ut->ut_user, ut->ut_line, str6, - ctime(&thyme) + 4, ut->ut_host); + ctime(&(ut->ut_tv.tv_sec)) + 4, ut->ut_host); if (ENABLE_FEATURE_CLEAN_UP) free(name); } -- 2.25.1