Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/miscutils/last.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/miscutils/last.c

    r2725 r3232  
    88 */
    99
     10//usage:#define last_trivial_usage
     11//usage:       ""IF_FEATURE_LAST_FANCY("[-HW] [-f FILE]")
     12//usage:#define last_full_usage "\n\n"
     13//usage:       "Show listing of the last users that logged into the system"
     14//usage:    IF_FEATURE_LAST_FANCY( "\n"
     15/* //usage:  "\n    -H  Show header line" */
     16//usage:     "\n    -W  Display with no host column truncation"
     17//usage:     "\n    -f FILE Read from FILE instead of /var/log/wtmp"
     18//usage:    )
     19
    1020#include "libbb.h"
    11 #include <utmp.h>
    1221
    1322/* NB: ut_name and ut_user are the same field, use only one name (ut_user)
     
    6372
    6473    printf("%-10s %-14s %-18s %-12.12s %s\n",
    65            "USER", "TTY", "HOST", "LOGIN", "TIME");
     74        "USER", "TTY", "HOST", "LOGIN", "TIME");
    6675    /* yikes. We reverse over the file and that is a not too elegant way */
    6776    pos = xlseek(file, 0, SEEK_END);
     
    123132        t_tmp = (time_t)ut.ut_tv.tv_sec;
    124133        printf("%-10s %-14s %-18s %-12.12s\n",
    125                ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4);
     134            ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4);
    126135 next:
    127136        pos -= sizeof(ut);
Note: See TracChangeset for help on using the changeset viewer.