version 1.23, 2015/10/09 01:37:08 |
version 1.24, 2017/03/11 18:33:21 |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <struct.h> |
|
#include <unistd.h> |
#include <unistd.h> |
#include <utmp.h> |
#include <utmp.h> |
#include <pwd.h> |
#include <pwd.h> |
|
|
ab.ac_comm[1] = '\0'; |
ab.ac_comm[1] = '\0'; |
} else |
} else |
for (p = &ab.ac_comm[0]; |
for (p = &ab.ac_comm[0]; |
p < &ab.ac_comm[fldsiz(acct, ac_comm)] && *p; ++p) |
p < &ab.ac_comm[sizeof ab.ac_comm] && *p; ++p) |
if (!isprint((unsigned char)*p)) |
if (!isprint((unsigned char)*p)) |
*p = '?'; |
*p = '?'; |
if (!*argv || requested(argv, &ab)) |
if (!*argv || requested(argv, &ab)) |
{ |
{ |
t = expand(ab.ac_utime) + expand(ab.ac_stime); |
t = expand(ab.ac_utime) + expand(ab.ac_stime); |
(void)printf("%-*.*s %-7s %-*.*s %-*.*s %6.2f secs %.16s", |
(void)printf("%-*.*s %-7s %-*.*s %-*.*s %6.2f secs %.16s", |
(int)fldsiz(acct, ac_comm), |
(int)sizeof ab.ac_comm, |
(int)fldsiz(acct, ac_comm), |
(int)sizeof ab.ac_comm, |
ab.ac_comm, flagbits(ab.ac_flag), UT_NAMESIZE, |
ab.ac_comm, flagbits(ab.ac_flag), UT_NAMESIZE, |
UT_NAMESIZE, user_from_uid(ab.ac_uid, 0), |
UT_NAMESIZE, user_from_uid(ab.ac_uid, 0), |
UT_LINESIZE, UT_LINESIZE, getdev(ab.ac_tty), |
UT_LINESIZE, UT_LINESIZE, getdev(ab.ac_tty), |
|
|
return (1); |
return (1); |
if (!strcmp(getdev(acp->ac_tty), *argv)) |
if (!strcmp(getdev(acp->ac_tty), *argv)) |
return (1); |
return (1); |
if (!strncmp(acp->ac_comm, *argv, fldsiz(acct, ac_comm))) |
if (!strncmp(acp->ac_comm, *argv, sizeof acp->ac_comm)) |
return (1); |
return (1); |
} while (*++argv); |
} while (*++argv); |
return (0); |
return (0); |