aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-17 23:50:14 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-17 23:50:14 +0000
commitd04e1fc309f3df9e1be2dde7556fda47ac577c5a (patch)
tree7bc22205526ded4be1bbb1372c12f10295b5cc11
parent2794c9bb938346f446ddc383b2621f6e6be6fdc8 (diff)
downloadbusybox-w32-d04e1fc309f3df9e1be2dde7556fda47ac577c5a.tar.gz
busybox-w32-d04e1fc309f3df9e1be2dde7556fda47ac577c5a.tar.bz2
busybox-w32-d04e1fc309f3df9e1be2dde7556fda47ac577c5a.zip
last: style fixes
-rw-r--r--miscutils/last.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/miscutils/last.c b/miscutils/last.c
index de2d2bb51..749862c35 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -38,7 +38,8 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
38 } 38 }
39 file = xopen(bb_path_wtmp_file, O_RDONLY); 39 file = xopen(bb_path_wtmp_file, O_RDONLY);
40 40
41 printf("%-10s %-14s %-18s %-12.12s %s\n", "USER", "TTY", "HOST", "LOGIN", "TIME"); 41 printf("%-10s %-14s %-18s %-12.12s %s\n",
42 "USER", "TTY", "HOST", "LOGIN", "TIME");
42 while ((n = full_read(file, &ut, sizeof(ut))) > 0) { 43 while ((n = full_read(file, &ut, sizeof(ut))) > 0) {
43 if (n != sizeof(ut)) { 44 if (n != sizeof(ut)) {
44 bb_perror_msg_and_die("short read"); 45 bb_perror_msg_and_die("short read");
@@ -63,8 +64,12 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
63 ut.ut_type = USER_PROCESS; 64 ut.ut_type = USER_PROCESS;
64 } 65 }
65 if (strcmp(ut.ut_name, "date") == 0) { 66 if (strcmp(ut.ut_name, "date") == 0) {
66 if (ut.ut_line[0] == '|') ut.ut_type = OLD_TIME; 67 if (ut.ut_line[0] == '|') {
67 if (ut.ut_line[0] == '{') ut.ut_type = NEW_TIME; 68 ut.ut_type = OLD_TIME;
69 }
70 if (ut.ut_line[0] == '{') {
71 ut.ut_type = NEW_TIME;
72 }
68 } 73 }
69 } 74 }
70 75
@@ -81,8 +86,8 @@ int last_main(int argc, char **argv ATTRIBUTE_UNUSED)
81 } 86 }
82 } 87 }
83 t_tmp = (time_t)ut.ut_tv.tv_sec; 88 t_tmp = (time_t)ut.ut_tv.tv_sec;
84 printf("%-10s %-14s %-18s %-12.12s\n", ut.ut_user, ut.ut_line, ut.ut_host, 89 printf("%-10s %-14s %-18s %-12.12s\n",
85 ctime(&t_tmp) + 4); 90 ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4);
86 } 91 }
87 92
88 fflush_stdout_and_exit(EXIT_SUCCESS); 93 fflush_stdout_and_exit(EXIT_SUCCESS);