summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ac
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-05-30 19:09:05 +0000
committerderaadt <deraadt@openbsd.org>2002-05-30 19:09:05 +0000
commit0f3328b94a3d18283589340dad5f16f5fd537364 (patch)
treee97fc9e2d6c0f85d4f31353120d7a6f1e6efad8f /usr.sbin/ac
parentminor tweaks (diff)
downloadwireguard-openbsd-0f3328b94a3d18283589340dad5f16f5fd537364.tar.xz
wireguard-openbsd-0f3328b94a3d18283589340dad5f16f5fd537364.zip
minor KNF
Diffstat (limited to 'usr.sbin/ac')
-rw-r--r--usr.sbin/ac/ac.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/ac/ac.c b/usr.sbin/ac/ac.c
index ecc8e1dc44b..cae5625f1d0 100644
--- a/usr.sbin/ac/ac.c
+++ b/usr.sbin/ac/ac.c
@@ -14,7 +14,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: ac.c,v 1.11 2002/02/17 19:42:35 millert Exp $";
+static char rcsid[] = "$Id: ac.c,v 1.12 2002/05/30 19:09:05 deraadt Exp $";
#endif
#include <sys/types.h>
@@ -122,7 +122,7 @@ add_tty(name)
register char *rcp;
Flags |= AC_T;
-
+
if ((tp = NEW(struct tty_list)) == NULL)
err(1, "malloc");
tp->len = 0; /* full match */
@@ -150,7 +150,7 @@ do_tty(name)
{
struct tty_list *tp;
int def_ret = 0;
-
+
for (tp = Ttys; tp != NULL; tp = tp->next) {
if (tp->ret == 0) /* specific don't */
def_ret = 1; /* default do */
@@ -207,7 +207,7 @@ update_user(head, name, secs)
*/
if (Flags & AC_U)
return head;
-
+
if ((up = NEW(struct user_list)) == NULL)
err(1, "malloc");
up->next = head;
@@ -275,11 +275,11 @@ main(argc, argv)
*/
if (access(_PATH_WTMP, 0) != 0 && errno == ENOENT)
return 0;
-
+
fp = file(_PATH_WTMP);
}
ac(fp);
-
+
return 0;
}
@@ -324,7 +324,7 @@ show_today(users, logins, secs)
/* restore the missing second */
yesterday++;
-
+
for (lp = logins; lp != NULL; lp = lp->next) {
secs = yesterday - lp->usr.ut_time;
Users = update_user(Users, lp->usr.ut_name, secs);
@@ -351,7 +351,7 @@ log_out(head, up)
{
struct utmp_list *lp, *lp2, *tlp;
time_t secs;
-
+
for (lp = head, lp2 = NULL; lp != NULL; )
if (*up->ut_line == '~' || strncmp(lp->usr.ut_line, up->ut_line,
sizeof (up->ut_line)) == 0) {
@@ -461,7 +461,7 @@ ac(fp)
struct tm *ltm;
time_t secs = 0;
int day = -1;
-
+
while (fread((char *)&usr, sizeof(usr), 1, fp) == 1) {
if (!FirstTime)
FirstTime = usr.ut_time;
@@ -515,7 +515,7 @@ ac(fp)
if (!(Flags & AC_W))
usr.ut_time = time((time_t *)0);
(void)strcpy(usr.ut_line, "~");
-
+
if (Flags & AC_D) {
ltm = localtime(&usr.ut_time);
if (day >= 0 && day != ltm->tm_yday) {