From dbd4bd2915052b1ba472fcf66df8233e6efa0ed7 Mon Sep 17 00:00:00 2001 From: guenther Date: Sat, 24 Oct 2015 18:13:18 +0000 Subject: [PATCH] Move #includes from private.h to the .c files that need them, getting rid of several. Switch from FILENAME_MAX to PATH_MAX (it's for open(), not fopen()). ok deraadt@ tedu@ krw@ --- lib/libc/time/asctime.c | 5 ++++- lib/libc/time/localtime.c | 9 +++++++-- lib/libc/time/private.h | 14 +------------- lib/libc/time/strftime.c | 5 +++-- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/lib/libc/time/asctime.c b/lib/libc/time/asctime.c index 16203d747e7..d2a0d19e94d 100644 --- a/lib/libc/time/asctime.c +++ b/lib/libc/time/asctime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asctime.c,v 1.22 2015/09/12 14:35:40 guenther Exp $ */ +/* $OpenBSD: asctime.c,v 1.23 2015/10/24 18:13:18 guenther Exp $ */ /* ** This file is in the public domain, so clarified as of ** 1996-06-05 by Arthur David Olson. @@ -10,6 +10,9 @@ ** whereas the output of asctime is supposed to be constant. */ +#include +#include +#include #include "private.h" #include "tzfile.h" #include "thread_private.h" diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index eaf989741a0..8ac4433a31f 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: localtime.c,v 1.54 2015/09/19 04:02:21 guenther Exp $ */ +/* $OpenBSD: localtime.c,v 1.55 2015/10/24 18:13:18 guenther Exp $ */ /* ** This file is in the public domain, so clarified as of ** 1996-06-05 by Arthur David Olson. @@ -10,8 +10,13 @@ */ #include +#include #include #include /* for FLT_MAX and DBL_MAX */ +#include +#include +#include +#include #include "private.h" #include "tzfile.h" @@ -324,7 +329,7 @@ tzload(const char *name, struct state *sp, int doextend) } u_t; u_t * up; int doaccess; - char fullname[FILENAME_MAX]; + char fullname[PATH_MAX]; up = calloc(1, sizeof *up); if (up == NULL) diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h index 6a11fae0796..f4f09e29851 100644 --- a/lib/libc/time/private.h +++ b/lib/libc/time/private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: private.h,v 1.37 2015/04/07 01:47:04 millert Exp $ */ +/* $OpenBSD: private.h,v 1.38 2015/10/24 18:13:18 guenther Exp $ */ #ifndef PRIVATE_H #define PRIVATE_H @@ -30,20 +30,8 @@ ** Nested includes */ -#include /* for time_t */ -#include -#include -#include #include /* for CHAR_BIT et al. */ #include -#include - - -#include /* for WIFEXITED and WEXITSTATUS */ - -#include /* for F_OK, R_OK, and other POSIX goodness */ - -#include /* ** Finally, some convenience items. diff --git a/lib/libc/time/strftime.c b/lib/libc/time/strftime.c index 84c4c18e38f..aea2e2f8e6b 100644 --- a/lib/libc/time/strftime.c +++ b/lib/libc/time/strftime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strftime.c,v 1.27 2015/09/12 14:35:40 guenther Exp $ */ +/* $OpenBSD: strftime.c,v 1.28 2015/10/24 18:13:18 guenther Exp $ */ /* ** Copyright (c) 1989, 1993 ** The Regents of the University of California. All rights reserved. @@ -30,6 +30,7 @@ #include #include +#include #include "private.h" #include "tzfile.h" @@ -612,7 +613,7 @@ _loc(void) char * p; const char ** ap; const char * plim; - char filename[FILENAME_MAX]; + char filename[PATH_MAX]; struct stat st; size_t namesize; size_t bufsize; -- 2.20.1