Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/last/last.c
Show All 12 Lines | |||||
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 All 12 Lines |