diff options
38 files changed, 96 insertions, 89 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index 0975ab3ac79..5156117d2a4 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -1,4 +1,4 @@ -/* $OpenBSD: date.c,v 1.44 2015/02/07 02:09:13 deraadt Exp $ */ +/* $OpenBSD: date.c,v 1.45 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */ /* @@ -42,7 +42,6 @@ #include <locale.h> #include <syslog.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <util.h> diff --git a/bin/ls/print.c b/bin/ls/print.c index ccc1d856ec1..6709c7b27e3 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.33 2015/01/16 06:39:32 deraadt Exp $ */ +/* $OpenBSD: print.c,v 1.34 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */ /* @@ -45,7 +45,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <util.h> @@ -63,7 +62,9 @@ static int compute_columns(DISPLAY *, int *); #define IS_NOPRINT(p) ((p)->fts_number == NO_PRINT) #define DATELEN 64 -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) + +#define SECSPERDAY (24 * 60 * 60) +#define SIXMONTHS (SECSPERDAY * 365 / 2) void printscol(DISPLAY *dp) diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index 29330efaba6..ecba9017f48 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gen_subs.c,v 1.26 2014/07/14 05:58:19 guenther Exp $ */ +/* $OpenBSD: gen_subs.c,v 1.27 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */ /*- @@ -38,7 +38,6 @@ #include <sys/time.h> #include <sys/stat.h> #include <stdio.h> -#include <tzfile.h> #include <utmp.h> #include <unistd.h> #include <stdlib.h> @@ -56,7 +55,8 @@ */ #define MODELEN 20 #define DATELEN 64 -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) +#define SECSPERDAY (24 * 60 * 60) +#define SIXMONTHS (SECSPERDAY * 365 / 2) #define CURFRMT "%b %e %H:%M" #define OLDFRMT "%b %e %Y" #define NAME_WIDTH 8 diff --git a/bin/ps/print.c b/bin/ps/print.c index 3c22518397e..a272589af75 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.59 2015/01/16 06:39:32 deraadt Exp $ */ +/* $OpenBSD: print.c,v 1.60 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */ /*- @@ -46,7 +46,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <pwd.h> @@ -408,6 +407,9 @@ started(const struct kinfo_proc *kp, VARENT *ve) return; } +#define SECSPERHOUR (60 * 60) +#define SECSPERDAY (24 * 60 * 60) + startt = kp->p_ustart_sec; tp = localtime(&startt); if (!now) diff --git a/games/pom/pom.c b/games/pom/pom.c index 0dcb72db9e1..531f2806fa5 100644 --- a/games/pom/pom.c +++ b/games/pom/pom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pom.c,v 1.14 2009/12/31 13:02:08 sobrado Exp $ */ +/* $OpenBSD: pom.c,v 1.15 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: pom.c,v 1.6 1996/02/06 22:47:29 jtc Exp $ */ /* @@ -52,7 +52,6 @@ #include <string.h> #include <math.h> #include <err.h> -#include <tzfile.h> #include <unistd.h> #ifndef M_PI @@ -67,6 +66,8 @@ #define Pzero 36.340410 /* lunar mean long of perigee at EPOCH */ #define Nzero 318.510107 /* lunar mean long of node at EPOCH */ +#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) + void adj360(double *); double dtor(double); double potm(double); diff --git a/include/time.h b/include/time.h index 537d9eaa0fc..02b35575371 100644 --- a/include/time.h +++ b/include/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.25 2013/06/17 19:11:54 guenther Exp $ */ +/* $OpenBSD: time.h,v 1.26 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* @@ -166,6 +166,11 @@ int clock_getcpuclockid(pid_t, clockid_t *); #endif #if __BSD_VISIBLE + +#ifndef TM_YEAR_BASE +#define TM_YEAR_BASE 1900 +#endif + char *timezone(int, int); void tzsetwall(void); time_t timelocal(struct tm *); diff --git a/lib/libutil/check_expire.c b/lib/libutil/check_expire.c index cc141311dad..6fd0bd3ddd4 100644 --- a/lib/libutil/check_expire.c +++ b/lib/libutil/check_expire.c @@ -1,4 +1,4 @@ -/* $OpenBSD: check_expire.c,v 1.10 2014/08/25 07:50:25 doug Exp $ */ +/* $OpenBSD: check_expire.c,v 1.11 2015/03/15 00:41:27 millert Exp $ */ /* * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. @@ -45,7 +45,6 @@ #include <string.h> #include <syslog.h> #include <time.h> -#include <tzfile.h> #include <login_cap.h> #include <bsd_auth.h> @@ -53,6 +52,9 @@ static char *pwd_update(const struct passwd *, const struct passwd *); +#define SECSPERDAY (24 * 60 * 60) +#define TWOWEEKS (2 * 7 * SECSPERDAY) + int login_check_expire(FILE *back, struct passwd *pwd, char *class, int lastchance) { @@ -85,8 +87,7 @@ login_check_expire(FILE *back, struct passwd *pwd, char *class, int lastchance) } else { dead = login_getcaptime(lc, "password-dead", 0, 0); warn = login_getcaptime(lc, "password-warn", - 2 * DAYSPERWEEK * SECSPERDAY, - 2 * DAYSPERWEEK * SECSPERDAY); + TWOWEEKS, TWOWEEKS); if (dead < 0) { syslog(LOG_ERR, "class %s password-dead is %qd", lc->lc_class, dead); diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index a1de80ed99c..36e79b2b536 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpcmd.y,v 1.57 2015/01/16 06:39:50 deraadt Exp $ */ +/* $OpenBSD: ftpcmd.y,v 1.58 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $ */ /* @@ -51,7 +51,6 @@ #include <glob.h> #include <pwd.h> #include <signal.h> -#include <tzfile.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 74416bd9184..400f5ff941b 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: optr.c,v 1.35 2015/01/16 06:39:57 deraadt Exp $ */ +/* $OpenBSD: optr.c,v 1.36 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */ /*- @@ -44,7 +44,6 @@ #include <stdlib.h> #include <string.h> #include <stdarg.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <utmp.h> @@ -360,6 +359,8 @@ fstabsearch(char *key) return (NULL); } +#define SECSPERDAY (24 * 60 * 60) + /* * Tell the operator what to do * w ==> just what to do; W ==> most recent dumps diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 7f83c5b1160..d186c59f2b6 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savecore.c,v 1.50 2015/01/16 06:40:00 deraadt Exp $ */ +/* $OpenBSD: savecore.c,v 1.51 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */ /*- @@ -46,7 +46,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <zlib.h> @@ -569,7 +568,8 @@ get_crashtime(void) return (0); } (void)printf("savecore: system went down at %s", ctime(&dumptime)); -#define LEEWAY (7 * SECSPERDAY) +#define SECSPERDAY (24 * 60 * 60) +#define LEEWAY (7 * SECSPERDAY) if (dumptime < now - LEEWAY || dumptime > now + LEEWAY) { (void)printf("dump time is unreasonable\n"); return (0); diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index 31e814ffb4a..f9eae2ca01d 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shutdown.c,v 1.40 2015/01/21 19:38:53 naddy Exp $ */ +/* $OpenBSD: shutdown.c,v 1.41 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: shutdown.c,v 1.9 1995/03/18 15:01:09 cgd Exp $ */ /* @@ -46,7 +46,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <errno.h> diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c index f4208345166..e95813e8dec 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parsetime.c,v 1.20 2014/01/13 23:18:57 millert Exp $ */ +/* $OpenBSD: parsetime.c,v 1.21 2015/03/15 00:41:27 millert Exp $ */ /* * parsetime.c - parse time for at(1) @@ -42,7 +42,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include "globals.h" diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c index 2af04fe7e70..df7a02620c8 100644 --- a/usr.bin/cal/cal.c +++ b/usr.bin/cal/cal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cal.c,v 1.26 2013/11/20 21:33:17 deraadt Exp $ */ +/* $OpenBSD: cal.c,v 1.27 2015/03/15 00:41:27 millert Exp $ */ /* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */ /* @@ -41,7 +41,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #define THURSDAY 4 /* for reformation */ diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index c873017b377..85c28be895d 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: calendar.c,v 1.29 2015/02/08 23:40:34 deraadt Exp $ */ +/* $OpenBSD: calendar.c,v 1.30 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include "pathnames.h" diff --git a/usr.bin/calendar/calendar.h b/usr.bin/calendar/calendar.h index b6ea8175f27..f329a079a22 100644 --- a/usr.bin/calendar/calendar.h +++ b/usr.bin/calendar/calendar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: calendar.h,v 1.13 2010/04/28 18:20:15 jsg Exp $ */ +/* $OpenBSD: calendar.h,v 1.14 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -95,6 +95,9 @@ void setnnames(void); * calendar time--e.g. Easter or easter depending * days */ +#define SECSPERDAY (24 * 60 * 60) +#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) + extern int f_dayAfter; /* days after current date */ extern int f_dayBefore; /* days before current date */ extern int f_SetdayAfter; /* calendar invoked with -A */ diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c index 4a164ba3062..ab8308e4f68 100644 --- a/usr.bin/calendar/day.c +++ b/usr.bin/calendar/day.c @@ -1,4 +1,4 @@ -/* $OpenBSD: day.c,v 1.27 2013/11/26 13:18:53 deraadt Exp $ */ +/* $OpenBSD: day.c,v 1.28 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -39,7 +39,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include "pathnames.h" #include "calendar.h" diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 31c413bb7db..d0a5e5847be 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.37 2015/01/16 06:40:06 deraadt Exp $ */ +/* $OpenBSD: io.c,v 1.38 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -44,7 +44,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> diff --git a/usr.bin/calendar/ostern.c b/usr.bin/calendar/ostern.c index c86c577eb62..85d4d473400 100644 --- a/usr.bin/calendar/ostern.c +++ b/usr.bin/calendar/ostern.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ostern.c,v 1.7 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: ostern.c,v 1.8 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1996 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. @@ -25,12 +25,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ostern.c,v 1.7 2009/10/27 23:59:36 deraadt Exp $ + * $Id: ostern.c,v 1.8 2015/03/15 00:41:28 millert Exp $ */ #include <stdio.h> #include <time.h> -#include <tzfile.h> #include "calendar.h" diff --git a/usr.bin/calendar/paskha.c b/usr.bin/calendar/paskha.c index fb958cdcfc9..4d817eb744a 100644 --- a/usr.bin/calendar/paskha.c +++ b/usr.bin/calendar/paskha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paskha.c,v 1.6 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: paskha.c,v 1.7 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (C) 1993-1996 by Andrey A. Chernov, Moscow, Russia. @@ -27,7 +27,6 @@ */ #include <stdio.h> -#include <tzfile.h> #include "calendar.h" diff --git a/usr.bin/calendar/pesach.c b/usr.bin/calendar/pesach.c index 70bbff26021..c44d336300d 100644 --- a/usr.bin/calendar/pesach.c +++ b/usr.bin/calendar/pesach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pesach.c,v 1.3 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: pesach.c,v 1.4 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 2004 Michael Shalayeff @@ -18,7 +18,6 @@ */ #include <stdio.h> -#include <tzfile.h> #include "calendar.h" diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c index 8e9c5e99bcf..0f8bda2c15c 100644 --- a/usr.bin/chpass/util.c +++ b/usr.bin/chpass/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.12 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.13 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: util.c,v 1.4 1995/03/26 04:55:35 glass Exp $ */ /*- @@ -38,7 +38,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include "chpass.h" diff --git a/usr.bin/find/find.h b/usr.bin/find/find.h index 6380c93f82f..0d7690f034b 100644 --- a/usr.bin/find/find.h +++ b/usr.bin/find/find.h @@ -1,4 +1,4 @@ -/* $OpenBSD: find.h,v 1.16 2015/01/19 15:30:52 krw Exp $ */ +/* $OpenBSD: find.h,v 1.17 2015/03/15 00:41:28 millert Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -133,4 +133,7 @@ typedef struct _option { int flags; } OPTION; +#define SECSPERDAY (24 * 60 * 60) +#define SIXMONTHS (SECSPERDAY * 365 / 2) + #include "extern.h" diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index be4e013393f..6037db0b287 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1,4 +1,4 @@ -/* $OpenBSD: function.c,v 1.42 2015/01/16 06:40:07 deraadt Exp $ */ +/* $OpenBSD: function.c,v 1.43 2015/03/15 00:41:28 millert Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -49,7 +49,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include "find.h" diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index adbc0d7e81c..230c8ea93f4 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ls.c,v 1.16 2015/01/16 06:40:07 deraadt Exp $ */ +/* $OpenBSD: ls.c,v 1.17 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989, 1993 @@ -36,7 +36,6 @@ #include <stdio.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <utmp.h> @@ -53,7 +52,6 @@ static void printtime(time_t); #define NAME_WIDTH 8 #define DATELEN 64 -#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY) void printlong(char *name, char *accpath, struct stat *sb) diff --git a/usr.bin/finger/finger.h b/usr.bin/finger/finger.h index f533a711ddf..c1b2a740322 100644 --- a/usr.bin/finger/finger.h +++ b/usr.bin/finger/finger.h @@ -1,4 +1,4 @@ -/* $OpenBSD: finger.h,v 1.7 2015/01/19 15:30:52 krw Exp $ */ +/* $OpenBSD: finger.h,v 1.8 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. * All rights reserved. @@ -38,6 +38,9 @@ #define _PATH_MAILSPOOL "/var/mail" +#define SECSPERDAY (24 * 60 * 60) +#define SIXMONTHS (SECSPERDAY * 365 / 2) + /* * All unique persons are linked in a list headed by "head" and linkd * by the "next" field, as well as kept in a hash table. diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c index a6a5a598854..b3dce893c89 100644 --- a/usr.bin/finger/lprint.c +++ b/usr.bin/finger/lprint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lprint.c,v 1.11 2014/10/17 20:19:15 millert Exp $ */ +/* $OpenBSD: lprint.c,v 1.12 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -36,7 +36,6 @@ #include <sys/file.h> #include <sys/stat.h> #include <sys/time.h> -#include <tzfile.h> #include <stdio.h> #include <string.h> #include <time.h> @@ -181,7 +180,7 @@ lprint(PERSON *pn) tp = localtime(&w->loginat); t = asctime(tp); tzn = tp->tm_zone; - if (now - w->loginat > SECSPERDAY * DAYSPERNYEAR / 2) + if (now - w->loginat > SIXMONTHS) 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 d2213edc0f6..81e23dd2f88 100644 --- a/usr.bin/finger/sprint.c +++ b/usr.bin/finger/sprint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sprint.c,v 1.14 2014/10/17 20:19:15 millert Exp $ */ +/* $OpenBSD: sprint.c,v 1.15 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -34,7 +34,6 @@ #include <sys/types.h> #include <sys/time.h> -#include <tzfile.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -101,11 +100,12 @@ sflag_print(void) } else (void)printf(" * "); p = ctime(&w->loginat); - if (now - w->loginat < SECSPERDAY * (DAYSPERWEEK - 1)) + + if (now - w->loginat < SECSPERDAY * 6) (void)printf(" %.3s", p); else (void)printf("%.6s", p + 4); - if (now - w->loginat >= SECSPERDAY * DAYSPERNYEAR / 2) + if (now - w->loginat >= SIXMONTHS) (void)printf(" %.4s ", p + 20); else (void)printf(" %.5s", p + 11); diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index a3533e3bcf2..2013c8aff65 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.70 2015/02/09 04:10:50 tedu Exp $ */ +/* $OpenBSD: util.c,v 1.71 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */ /*- @@ -82,7 +82,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include "ftp_var.h" diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 042cbadbe68..ba3c8aec66c 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -1,4 +1,4 @@ -/* $OpenBSD: last.c,v 1.47 2015/03/14 18:00:31 deraadt Exp $ */ +/* $OpenBSD: last.c,v 1.48 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: last.c,v 1.6 1994/12/24 16:49:02 cgd Exp $ */ /* @@ -42,7 +42,6 @@ #include <stdlib.h> #include <string.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <utmp.h> @@ -91,6 +90,8 @@ void usage(void); #define NAME_WIDTH 9 #define HOST_WIDTH 24 +#define SECSPERDAY (24 * 60 * 60) + int main(int argc, char *argv[]) { diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c index 9aa1dd6ece7..94f107393be 100644 --- a/usr.bin/lastcomm/lastcomm.c +++ b/usr.bin/lastcomm/lastcomm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lastcomm.c,v 1.20 2015/01/16 06:40:09 deraadt Exp $ */ +/* $OpenBSD: lastcomm.c,v 1.21 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: lastcomm.c,v 1.9 1995/10/22 01:43:42 ghudson Exp $ */ /* @@ -42,7 +42,6 @@ #include <stdlib.h> #include <string.h> #include <struct.h> -#include <tzfile.h> #include <unistd.h> #include <utmp.h> #include <pwd.h> @@ -54,6 +53,9 @@ char *getdev(dev_t); int requested(char *[], struct acct *); void usage(void); +#define SECSPERMIN (60) +#define SECSPERHOUR (60 * 60) + int main(int argc, char *argv[]) { diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 8816252d385..34a92eefd52 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login.c,v 1.63 2015/01/16 06:40:09 deraadt Exp $ */ +/* $OpenBSD: login.c,v 1.64 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: login.c,v 1.13 1996/05/15 23:50:16 jtc Exp $ */ /*- @@ -90,7 +90,6 @@ #include <string.h> #include <syslog.h> #include <ttyent.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <utmp.h> @@ -117,6 +116,9 @@ extern void log_failedlogin(uid_t, char *, char *, char *); #define TTYGRPNAME "tty" /* name of group to own ttys */ +#define SECSPERDAY (24 * 60 * 60) +#define TWOWEEKS (2 * 7 * SECSPERDAY) + /* * This bounds the time given to login; may be overridden by /etc/login.conf. */ @@ -656,7 +658,7 @@ failed: quickexit(1); } else if (expire > 0 && !quietlog) { warning = login_getcaptime(lc, "expire-warn", - 2 * DAYSPERWEEK * SECSPERDAY, 2 * DAYSPERWEEK * SECSPERDAY); + TWOWEEKS, TWOWEEKS); if (expire < warning) (void)printf("Warning: your account expires on %s", ctime(&pwd->pw_expire)); diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 056242afc76..83b3cce43cd 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: script.c,v 1.25 2009/10/27 23:59:43 deraadt Exp $ */ +/* $OpenBSD: script.c,v 1.26 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */ /* @@ -69,7 +69,6 @@ #include <stdlib.h> #include <string.h> #include <termios.h> -#include <tzfile.h> #include <unistd.h> #include <util.h> @@ -242,7 +241,7 @@ dooutput(void) sa.sa_handler = scriptflush; (void)sigaction(SIGALRM, &sa, NULL); - value.it_interval.tv_sec = SECSPERMIN / 2; + value.it_interval.tv_sec = 30; value.it_interval.tv_usec = 0; value.it_value = value.it_interval; (void)setitimer(ITIMER_REAL, &value, NULL); diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index da4dbbee960..a108a055963 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: touch.c,v 1.21 2011/08/31 08:48:40 jmc Exp $ */ +/* $OpenBSD: touch.c,v 1.22 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */ /* @@ -43,7 +43,6 @@ #include <string.h> #include <locale.h> #include <time.h> -#include <tzfile.h> #include <unistd.h> void stime_arg1(char *, struct timespec *); diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 44611c1b8f9..8d5ca580176 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vacation.c,v 1.35 2015/01/16 06:40:13 deraadt Exp $ */ +/* $OpenBSD: vacation.c,v 1.36 2015/03/15 00:41:28 millert Exp $ */ /* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */ /* @@ -42,7 +42,6 @@ #include <db.h> #include <time.h> #include <syslog.h> -#include <tzfile.h> #include <errno.h> #include <unistd.h> #include <stdio.h> @@ -83,6 +82,8 @@ void setinterval(time_t); void setreply(void); void usage(void); +#define SECSPERDAY (24 * 60 * 60) + int main(int argc, char *argv[]) { @@ -391,7 +392,7 @@ recent(void) key.data = VIT; key.size = sizeof(VIT); if ((db->get)(db, &key, &data, 0)) - next = SECSPERDAY * DAYSPERWEEK; + next = SECSPERDAY * 7; else bcopy(data.data, &next, sizeof(next)); diff --git a/usr.bin/w/extern.h b/usr.bin/w/extern.h index 4c1e6507fbf..4c114bce870 100644 --- a/usr.bin/w/extern.h +++ b/usr.bin/w/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.8 2011/04/10 03:20:59 guenther Exp $ */ +/* $OpenBSD: extern.h,v 1.9 2015/03/15 00:41:28 millert Exp $ */ /*- * Copyright (c) 1993 @@ -37,3 +37,6 @@ void fmt_putc(int, int *); void pr_attime(time_t *, time_t *); void pr_idle(time_t); int proc_compare(const struct kinfo_proc *, const struct kinfo_proc *); + +#define SECSPERHOUR (60 * 60) +#define SECSPERDAY (24 * 60 * 60) diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 462d9aa8432..d4fbfc2994d 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pr_time.c,v 1.15 2013/11/11 23:06:51 deraadt Exp $ */ +/* $OpenBSD: pr_time.c,v 1.16 2015/03/15 00:41:28 millert Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -34,7 +34,6 @@ #include <stdio.h> #include <string.h> -#include <tzfile.h> #include "extern.h" @@ -56,7 +55,7 @@ pr_attime(time_t *started, time_t *now) diff = *now - *started; /* If more than a week, use day-month-year. */ - if (diff > SECSPERDAY * DAYSPERWEEK) + if (diff > SECSPERDAY * 7) fmt = "%d%b%y"; /* If not today, use day-hour-am/pm. */ @@ -97,9 +96,9 @@ pr_idle(time_t idle) else if (idle >= SECSPERHOUR) (void)printf(" %2lld:%02lld ", (long long)idle / SECSPERHOUR, - ((long long)idle % SECSPERHOUR) / SECSPERMIN); + ((long long)idle % SECSPERHOUR) / 60); /* Else print the minutes idle. */ else - (void)printf(" %2lld ", (long long)idle / SECSPERMIN); + (void)printf(" %2lld ", (long long)idle / 60); } diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 08f6b951528..c15d5457abc 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w.c,v 1.57 2015/01/16 06:40:14 deraadt Exp $ */ +/* $OpenBSD: w.c,v 1.58 2015/03/15 00:41:28 millert Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -59,7 +59,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <tzfile.h> #include <unistd.h> #include <limits.h> #include <utmp.h> @@ -398,7 +397,7 @@ pr_header(time_t *nowp, int nusers) uptime %= SECSPERDAY; hrs = uptime / SECSPERHOUR; uptime %= SECSPERHOUR; - mins = uptime / SECSPERMIN; + mins = uptime / 60; (void)printf(" up"); if (days > 0) (void)printf(" %d day%s,", days, diff --git a/usr.sbin/tcpdump/privsep.c b/usr.sbin/tcpdump/privsep.c index da9dfd58867..c416eadb456 100644 --- a/usr.sbin/tcpdump/privsep.c +++ b/usr.sbin/tcpdump/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.32 2015/01/20 18:26:58 deraadt Exp $ */ +/* $OpenBSD: privsep.c,v 1.33 2015/03/15 00:41:28 millert Exp $ */ /* * Copyright (c) 2003 Can Erkin Acar @@ -41,7 +41,6 @@ #include <stdlib.h> #include <string.h> #include <syslog.h> -#include <tzfile.h> #include <unistd.h> #include "interface.h" @@ -701,7 +700,7 @@ priv_localtime(const time_t *t) { static struct tm lt, gt0; static struct tm *gt = NULL; - static char zone[TZ_MAX_CHARS]; + static char zone[PATH_MAX]; if (gt != NULL) { gt = gmtime(t); |