diff options
author | wollman <wollman@FreeBSD.org> | 1995-08-07 19:17:46 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-08-07 19:17:46 +0000 |
commit | fc1f6c1d76677a4e8d2c39e5fa7be3716841930e (patch) | |
tree | 413738746625eee30af858d100ea794582067fa4 /usr.bin | |
parent | c87e4ea046fafb0b07c7ac3335948b0743fed8b4 (diff) | |
download | FreeBSD-src-fc1f6c1d76677a4e8d2c39e5fa7be3716841930e.zip FreeBSD-src-fc1f6c1d76677a4e8d2c39e5fa7be3716841930e.tar.gz |
Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ar/contents.c | 1 | ||||
-rw-r--r-- | usr.bin/calendar/calendar.c | 6 | ||||
-rw-r--r-- | usr.bin/chpass/util.c | 9 | ||||
-rw-r--r-- | usr.bin/find/function.c | 9 | ||||
-rw-r--r-- | usr.bin/find/ls.c | 3 | ||||
-rw-r--r-- | usr.bin/finger/lprint.c | 3 | ||||
-rw-r--r-- | usr.bin/finger/sprint.c | 4 | ||||
-rw-r--r-- | usr.bin/last/last.c | 5 | ||||
-rw-r--r-- | usr.bin/login/login.c | 5 | ||||
-rw-r--r-- | usr.bin/ruptime/ruptime.c | 13 | ||||
-rw-r--r-- | usr.bin/script/script.c | 3 | ||||
-rw-r--r-- | usr.bin/vacation/vacation.c | 5 | ||||
-rw-r--r-- | usr.bin/w/pr_time.c | 17 | ||||
-rw-r--r-- | usr.bin/w/w.c | 11 |
14 files changed, 42 insertions, 52 deletions
diff --git a/usr.bin/ar/contents.c b/usr.bin/ar/contents.c index ffa4856..dc45b36 100644 --- a/usr.bin/ar/contents.c +++ b/usr.bin/ar/contents.c @@ -47,7 +47,6 @@ static char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94"; #include <fcntl.h> #include <stdio.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "archive.h" diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index c6e60dd..deb4cfc 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "pathnames.h" @@ -72,6 +71,7 @@ int isnow __P((char *)); FILE *opencal __P((void)); void settime __P((void)); void usage __P((void)); +#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) int main(argc, argv) @@ -172,10 +172,10 @@ settime() (void)time(&now); tp = localtime(&now); if (isleap(tp->tm_year + 1900)) { - yrdays = DAYSPERLYEAR; + yrdays = 366; cumdays = daytab[1]; } else { - yrdays = DAYSPERNYEAR; + yrdays = 365; cumdays = daytab[0]; } /* Friday displays Monday's events */ diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c index 8dfd388..fe89d79 100644 --- a/usr.bin/chpass/util.c +++ b/usr.bin/chpass/util.c @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include "chpass.h" @@ -64,7 +63,7 @@ ttoa(tval) if (tval) { tp = localtime(&tval); (void)sprintf(tbuf, "%s %d, %d", months[tp->tm_mon], - tp->tm_mday, tp->tm_year + TM_YEAR_BASE); + tp->tm_mday, tp->tm_year + 1900); } else *tbuf = '\0'; @@ -109,10 +108,10 @@ atot(p, store) if (day < 1 || day > 31 || month < 1 || month > 12 || !year) goto bad; if (year < 100) - year += TM_YEAR_BASE; - if (year <= EPOCH_YEAR) + year += 1900; + if (year <= 1970) bad: return (1); - lt->tm_year = year - TM_YEAR_BASE; + lt->tm_year = year - 1900; lt->tm_mon = month - 1; lt->tm_mday = day; lt->tm_hour = 0; diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 72a4e74..6bd85b5 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -53,7 +53,6 @@ static char sccsid[] = "@(#)function.c 8.6 (Berkeley) 4/1/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "find.h" @@ -140,7 +139,7 @@ f_atime(plan, entry) extern time_t now; COMPARE((now - entry->fts_statp->st_atime + - SECSPERDAY - 1) / SECSPERDAY, plan->t_data); + 86400 - 1) / 86400, plan->t_data); } PLAN * @@ -170,7 +169,7 @@ f_ctime(plan, entry) extern time_t now; COMPARE((now - entry->fts_statp->st_ctime + - SECSPERDAY - 1) / SECSPERDAY, plan->t_data); + 86400 - 1) / 86400, plan->t_data); } PLAN * @@ -577,8 +576,8 @@ f_mtime(plan, entry) { extern time_t now; - COMPARE((now - entry->fts_statp->st_mtime + SECSPERDAY - 1) / - SECSPERDAY, plan->t_data); + COMPARE((now - entry->fts_statp->st_mtime + 86400 - 1) / + 86400, plan->t_data); } PLAN * diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index dd51f97..929ef79 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)ls.c 8.1 (Berkeley) 6/6/93"; #include <stdio.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -90,7 +89,7 @@ printtime(ftime) for (i = 4; i < 11; ++i) (void)putchar(longstring[i]); -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) +#define SIXMONTHS ((365 / 2) * 86400) if (ftime + SIXMONTHS > time((time_t *)NULL)) for (i = 11; i < 16; ++i) (void)putchar(longstring[i]); diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c index 51e0f96..28a9be7 100644 --- a/usr.bin/finger/lprint.c +++ b/usr.bin/finger/lprint.c @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)lprint.c 8.1 (Berkeley) 6/6/93"; #include <sys/time.h> #include <fcntl.h> #include <time.h> -#include <tzfile.h> #include <db.h> #include <pwd.h> #include <utmp.h> @@ -207,7 +206,7 @@ lprint(pn) tp = localtime(&w->loginat); t = asctime(tp); tzn = tp->tm_zone; - if (now - w->loginat > SECSPERDAY * DAYSPERNYEAR / 2) + if (now - w->loginat > 86400 * 365 / 2) cpr = printf("Last login %.16s %.4s (%s) on %s", t, t + 20, tzn, w->tty); diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c index a6481cd..fdb3b6c 100644 --- a/usr.bin/finger/sprint.c +++ b/usr.bin/finger/sprint.c @@ -41,7 +41,6 @@ static char sccsid[] = "@(#)sprint.c 8.1 (Berkeley) 6/6/93"; #include <sys/types.h> #include <sys/time.h> #include <time.h> -#include <tzfile.h> #include <db.h> #include <pwd.h> #include <errno.h> @@ -117,6 +116,9 @@ sflag_print() } else (void)printf(" * "); p = ctime(&w->loginat); +#define SECSPERDAY 86400 +#define DAYSPERWEEK 7 +#define DAYSPERNYEAR 365 if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1)) (void)printf("%.3s ", p); else diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 662a663..1d18600 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -52,7 +52,6 @@ static char sccsid[] = "@(#)last.c 8.2 (Berkeley) 4/2/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -248,12 +247,12 @@ wtmp() printf("- %5.5s", ctime(&T->logout)+11); delta = T->logout - bp->ut_time; - if (delta < SECSPERDAY) + if (delta < 86400) printf(" (%5.5s)\n", asctime(gmtime(&delta))+11); else printf(" (%ld+%5.5s)\n", - delta / SECSPERDAY, + delta / 86400, asctime(gmtime(&delta))+11); } if (maxrec != -1 && !--maxrec) diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index b8bf1f6..f3f9ae6 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -64,7 +64,6 @@ static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; #include <string.h> #include <syslog.h> #include <ttyent.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> @@ -366,7 +365,7 @@ main(argc, argv) (void)printf("Sorry -- your password has expired.\n"); changepass=1; } else if (pwd->pw_change - tp.tv_sec < - 2 * DAYSPERWEEK * SECSPERDAY && !quietlog) + 2 * 7 * 86400 && !quietlog) (void)printf("Warning: your password expires on %s", ctime(&pwd->pw_change)); if (pwd->pw_expire) @@ -374,7 +373,7 @@ main(argc, argv) (void)printf("Sorry -- your account has expired.\n"); sleepexit(1); } else if (pwd->pw_expire - tp.tv_sec < - 2 * DAYSPERWEEK * SECSPERDAY && !quietlog) + 2 * 7 * 86400 && !quietlog) (void)printf("Warning: your account expires on %s", ctime(&pwd->pw_expire)); diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c index 24e2021..ba8cda5 100644 --- a/usr.bin/ruptime/ruptime.c +++ b/usr.bin/ruptime/ruptime.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id$ */ +/* $Id: ruptime.c,v 1.4 1995/07/22 22:28:31 joerg Exp $ */ #ifndef lint static char copyright[] = @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)ruptime.c 8.2 (Berkeley) 4/5/94"; #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> struct hs { @@ -203,11 +202,11 @@ interval(tval, updown) return (resbuf); } /* round to minutes. */ - minutes = (tval + (SECSPERMIN - 1)) / SECSPERMIN; - hours = minutes / MINSPERHOUR; - minutes %= MINSPERHOUR; - days = hours / HOURSPERDAY; - hours %= HOURSPERDAY; + minutes = (tval + (60 - 1)) / 60; + hours = minutes / 60; + minutes %= 60; + days = hours / 24; + hours %= 24; if (days) (void)snprintf(resbuf, sizeof(resbuf), "%s %2d+%02d:%02d", updown, days, hours, minutes); diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index e688d64..25c5ad6 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -55,7 +55,6 @@ static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #include <stdlib.h> #include <string.h> #include <termios.h> -#include <tzfile.h> #include <unistd.h> FILE *fscript; @@ -171,7 +170,7 @@ dooutput() (void)fprintf(fscript, "Script started on %s", ctime(&tvec)); (void)signal(SIGALRM, scriptflush); - value.it_interval.tv_sec = SECSPERMIN / 2; + value.it_interval.tv_sec = 60 / 2; value.it_interval.tv_usec = 0; value.it_value = value.it_interval; (void)setitimer(ITIMER_REAL, &value, NULL); diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 025eb98..ae549c8 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -54,7 +54,6 @@ static char sccsid[] = "@(#)vacation.c 8.2 (Berkeley) 1/26/94"; #include <db.h> #include <time.h> #include <syslog.h> -#include <tzfile.h> #include <errno.h> #include <unistd.h> #include <stdio.h> @@ -114,7 +113,7 @@ main(argc, argv) break; case 'r': if (isdigit(*optarg)) { - interval = atol(optarg) * SECSPERDAY; + interval = atol(optarg) * 86400; if (interval < 0) usage(); } @@ -319,7 +318,7 @@ recent() key.data = VIT; key.size = sizeof(VIT); if ((db->get)(db, &key, &data, 0)) - next = SECSPERDAY * DAYSPERWEEK; + next = 86400 * 7; else bcopy(data.data, &next, sizeof(next)); diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 91410ee..ba94b50 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -40,7 +40,6 @@ static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94"; #include <stdio.h> #include <string.h> -#include <tzfile.h> #include "extern.h" @@ -64,11 +63,11 @@ pr_attime(started, now) diff = *now - *started; /* If more than a week, use day-month-year. */ - if (diff > SECSPERDAY * DAYSPERWEEK) + if (diff > 86400 * 7) (void)strcpy(fmt, "%d%b%y"); /* If not today, use day-hour-am/pm. */ - else if (*now / SECSPERDAY != *started / SECSPERDAY) { + else if (*now / 86400 != *started / 86400) { (void)strcpy(fmt, __CONCAT("%a%", "I%p")); } @@ -90,18 +89,18 @@ pr_idle(idle) time_t idle; { /* If idle more than 36 hours, print as a number of days. */ - if (idle >= 36 * SECSPERHOUR) - (void)printf(" %ddays ", idle / SECSPERDAY); + if (idle >= 36 * 3600) + (void)printf(" %ddays ", idle / 86400); /* If idle more than an hour, print as HH:MM. */ - else if (idle >= SECSPERHOUR) + else if (idle >= 3600) (void)printf(" %2d:%02d ", - idle / SECSPERHOUR, (idle % SECSPERHOUR) / SECSPERMIN); + idle / 3600, (idle % 3600) / 60); - else if (idle / SECSPERMIN == 0) + else if (idle / 60 == 0) (void)printf(" - "); /* Else print the minutes idle. */ else - (void)printf(" %2d ", idle / SECSPERMIN); + (void)printf(" %2d ", idle / 60); } diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 6e006ad..e7cafca 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -72,7 +72,6 @@ static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> #include <vis.h> @@ -371,11 +370,11 @@ pr_header(nowp, nusers) boottime.tv_sec != 0) { uptime = now - boottime.tv_sec; uptime += 30; - days = uptime / SECSPERDAY; - uptime %= SECSPERDAY; - hrs = uptime / SECSPERHOUR; - uptime %= SECSPERHOUR; - mins = uptime / SECSPERMIN; + days = uptime / 86400; + uptime %= 86400; + hrs = uptime / 3600; + uptime %= 3600; + mins = uptime / 60; (void)printf(" up"); if (days > 0) (void)printf(" %d day%s,", days, days > 1 ? "s" : ""); |