mirror of
https://github.com/openbsd/src.git
synced 2025-01-04 23:35:36 -08:00
tzfile.h is an internal header that should never have been installed.
What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
This commit is contained in:
parent
0d8622be87
commit
f7055df57d
@ -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>
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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 *);
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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 */
|
||||
|
@ -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"
|
||||
|
@ -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 */
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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[])
|
||||
{
|
||||
|
@ -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[])
|
||||
{
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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 *);
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user