summaryrefslogtreecommitdiff
path: root/miscutils/last.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /miscutils/last.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'miscutils/last.c')
-rw-r--r--miscutils/last.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/miscutils/last.c b/miscutils/last.c
index 47c18ffa0..6e35879f3 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -8,15 +8,7 @@
8 */ 8 */
9 9
10#include "busybox.h" 10#include "busybox.h"
11#include <sys/types.h>
12#include <fcntl.h>
13#include <unistd.h>
14#include <stdlib.h>
15#include <utmp.h> 11#include <utmp.h>
16#include <sys/stat.h>
17#include <errno.h>
18#include <string.h>
19#include <time.h>
20 12
21#ifndef SHUTDOWN_TIME 13#ifndef SHUTDOWN_TIME
22# define SHUTDOWN_TIME 254 14# define SHUTDOWN_TIME 254
@@ -43,7 +35,7 @@ int last_main(int argc, char **argv)
43 if (argc > 1) { 35 if (argc > 1) {
44 bb_show_usage(); 36 bb_show_usage();
45 } 37 }
46 file = bb_xopen(bb_path_wtmp_file, O_RDONLY); 38 file = xopen(bb_path_wtmp_file, O_RDONLY);
47 39
48 printf("%-10s %-14s %-18s %-12.12s %s\n", "USER", "TTY", "HOST", "LOGIN", "TIME"); 40 printf("%-10s %-14s %-18s %-12.12s %s\n", "USER", "TTY", "HOST", "LOGIN", "TIME");
49 while ((n = safe_read(file, (void*)&ut, sizeof(struct utmp))) != 0) { 41 while ((n = safe_read(file, (void*)&ut, sizeof(struct utmp))) != 0) {