Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/last/last.c
Show First 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | while ((ut = getutxent()) != NULL) { | ||||
if (t > ut->ut_tv.tv_sec) | if (t > ut->ut_tv.tv_sec) | ||||
t = ut->ut_tv.tv_sec; | t = ut->ut_tv.tv_sec; | ||||
} | } | ||||
endutxent(); | endutxent(); | ||||
/* Display them in reverse order. */ | /* Display them in reverse order. */ | ||||
while (amount > 0) | while (amount > 0) | ||||
doentry(&buf[--amount]); | doentry(&buf[--amount]); | ||||
free(buf); | |||||
tm = localtime(&t); | tm = localtime(&t); | ||||
(void) strftime(ct, sizeof(ct), "%+", tm); | (void) strftime(ct, sizeof(ct), "%+", tm); | ||||
printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct); | printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct); | ||||
} | } | ||||
/* | /* | ||||
* doentry -- | * doentry -- | ||||
* process a single utx.log entry | * process a single utx.log entry | ||||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |