Deleted Added
full compact
ac.c (85649) ac.c (89572)
1/*
2 * Copyright (c) 1994 Christopher G. Demetriou.
3 * @(#)Copyright (c) 1994, Simon J. Gerraty.
4 *
5 * This is free software. It comes with NO WARRANTY.
6 * Permission to use, modify and distribute this source code
7 * is granted subject to the following conditions.
8 * 1/ that the above copyright notice and this notice
9 * are preserved in all copies and that due credit be given
10 * to the author.
11 * 2/ that any changes to this code are clearly commented
12 * as such so that the author does not get blamed for bugs
13 * other than his own.
14 */
15
16#ifndef lint
17static const char rcsid[] =
1/*
2 * Copyright (c) 1994 Christopher G. Demetriou.
3 * @(#)Copyright (c) 1994, Simon J. Gerraty.
4 *
5 * This is free software. It comes with NO WARRANTY.
6 * Permission to use, modify and distribute this source code
7 * is granted subject to the following conditions.
8 * 1/ that the above copyright notice and this notice
9 * are preserved in all copies and that due credit be given
10 * to the author.
11 * 2/ that any changes to this code are clearly commented
12 * as such so that the author does not get blamed for bugs
13 * other than his own.
14 */
15
16#ifndef lint
17static const char rcsid[] =
18 "$FreeBSD: head/usr.sbin/ac/ac.c 85649 2001-10-29 00:36:01Z dillon $";
18 "$FreeBSD: head/usr.sbin/ac/ac.c 89572 2002-01-19 23:20:02Z dillon $";
19#endif /* not lint */
20
21#include <sys/types.h>
22#include <sys/file.h>
23#include <sys/time.h>
24#include <err.h>
25#include <errno.h>
26#include <langinfo.h>

--- 441 unchanged lines hidden (view full) ---

468 struct tm *ltm;
469 time_t secs;
470 int day = -1;
471
472 while (fread((char *)&usr, sizeof(usr), 1, fp) == 1) {
473 if (!FirstTime)
474 FirstTime = usr.ut_time;
475 if (Flags & AC_D) {
19#endif /* not lint */
20
21#include <sys/types.h>
22#include <sys/file.h>
23#include <sys/time.h>
24#include <err.h>
25#include <errno.h>
26#include <langinfo.h>

--- 441 unchanged lines hidden (view full) ---

468 struct tm *ltm;
469 time_t secs;
470 int day = -1;
471
472 while (fread((char *)&usr, sizeof(usr), 1, fp) == 1) {
473 if (!FirstTime)
474 FirstTime = usr.ut_time;
475 if (Flags & AC_D) {
476 time_t t = int_to_time(usr.ut_time);
476 time_t t = _int_to_time(usr.ut_time);
477 ltm = localtime(&t);
478 if (day >= 0 && day != ltm->tm_yday) {
479 day = ltm->tm_yday;
480 /*
481 * print yesterday's total
482 */
483 secs = usr.ut_time;
484 secs -= ltm->tm_sec;

--- 35 unchanged lines hidden (view full) ---

520 }
521 }
522 (void)fclose(fp);
523 if (!(Flags & AC_W))
524 usr.ut_time = time((time_t *)0);
525 (void)strcpy(usr.ut_line, "~");
526
527 if (Flags & AC_D) {
477 ltm = localtime(&t);
478 if (day >= 0 && day != ltm->tm_yday) {
479 day = ltm->tm_yday;
480 /*
481 * print yesterday's total
482 */
483 secs = usr.ut_time;
484 secs -= ltm->tm_sec;

--- 35 unchanged lines hidden (view full) ---

520 }
521 }
522 (void)fclose(fp);
523 if (!(Flags & AC_W))
524 usr.ut_time = time((time_t *)0);
525 (void)strcpy(usr.ut_line, "~");
526
527 if (Flags & AC_D) {
528 time_t t = int_to_time(usr.ut_time);
528 time_t t = _int_to_time(usr.ut_time);
529 ltm = localtime(&t);
530 if (day >= 0 && day != ltm->tm_yday) {
531 /*
532 * print yesterday's total
533 */
534 secs = usr.ut_time;
535 secs -= ltm->tm_sec;
536 secs -= 60 * ltm->tm_min;

--- 30 unchanged lines hidden ---
529 ltm = localtime(&t);
530 if (day >= 0 && day != ltm->tm_yday) {
531 /*
532 * print yesterday's total
533 */
534 secs = usr.ut_time;
535 secs -= ltm->tm_sec;
536 secs -= 60 * ltm->tm_min;

--- 30 unchanged lines hidden ---