diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mtree/mtree.c | 3 | ||||
-rw-r--r-- | usr.sbin/newsyslog/newsyslog.c | 44 | ||||
-rw-r--r-- | usr.sbin/services_mkdb/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/services_mkdb/extern.h | 32 | ||||
-rw-r--r-- | usr.sbin/services_mkdb/services_mkdb.c | 2 | ||||
-rw-r--r-- | usr.sbin/services_mkdb/uniq.c | 2 |
6 files changed, 61 insertions, 24 deletions
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c index 49e3e6b..e90a5bb 100644 --- a/usr.sbin/mtree/mtree.c +++ b/usr.sbin/mtree/mtree.c @@ -52,7 +52,8 @@ __FBSDID("$FreeBSD$"); #include "extern.h" int ftsoptions = FTS_PHYSICAL; -int cflag, dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, Uflag, wflag; +int dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, wflag; +static int cflag, Uflag; u_int keys; char fullpath[MAXPATHLEN]; diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index 67a363e..875f911 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -145,7 +145,7 @@ struct compress_types { const char *path; /* Path to compression program */ }; -const struct compress_types compress_type[COMPRESS_TYPES] = { +static const struct compress_types compress_type[COMPRESS_TYPES] = { { "", "", "" }, /* no compression */ { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP }, /* gzip compression */ { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2 }, /* bzip2 compression */ @@ -206,42 +206,44 @@ typedef enum { } fk_entry; STAILQ_HEAD(cflist, conf_entry); -SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); -SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); +static SLIST_HEAD(swlisthead, sigwork_entry) swhead = + SLIST_HEAD_INITIALIZER(swhead); +static SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = + SLIST_HEAD_INITIALIZER(zwhead); STAILQ_HEAD(ilist, include_entry); int dbg_at_times; /* -D Show details of 'trim_at' code */ -int archtodir = 0; /* Archive old logfiles to other directory */ -int createlogs; /* Create (non-GLOB) logfiles which do not */ +static int archtodir = 0; /* Archive old logfiles to other directory */ +static int createlogs; /* Create (non-GLOB) logfiles which do not */ /* already exist. 1=='for entries with */ /* C flag', 2=='for all entries'. */ int verbose = 0; /* Print out what's going on */ -int needroot = 1; /* Root privs are necessary */ +static int needroot = 1; /* Root privs are necessary */ int noaction = 0; /* Don't do anything, just show it */ -int norotate = 0; /* Don't rotate */ -int nosignal; /* Do not send any signals */ -int enforcepid = 0; /* If PID file does not exist or empty, do nothing */ -int force = 0; /* Force the trim no matter what */ -int rotatereq = 0; /* -R = Always rotate the file(s) as given */ +static int norotate = 0; /* Don't rotate */ +static int nosignal; /* Do not send any signals */ +static int enforcepid = 0; /* If PID file does not exist or empty, do nothing */ +static int force = 0; /* Force the trim no matter what */ +static int rotatereq = 0; /* -R = Always rotate the file(s) as given */ /* on the command (this also requires */ /* that a list of files *are* given on */ /* the run command). */ -char *requestor; /* The name given on a -R request */ -char *timefnamefmt = NULL; /* Use time based filenames instead of .0 etc */ -char *archdirname; /* Directory path to old logfiles archive */ -char *destdir = NULL; /* Directory to treat at root for logs */ -const char *conf; /* Configuration file to use */ +static char *requestor; /* The name given on a -R request */ +static char *timefnamefmt = NULL;/* Use time based filenames instead of .0 */ +static char *archdirname; /* Directory path to old logfiles archive */ +static char *destdir = NULL; /* Directory to treat at root for logs */ +static const char *conf; /* Configuration file to use */ struct ptime_data *dbg_timenow; /* A "timenow" value set via -D option */ -struct ptime_data *timenow; /* The time to use for checking at-fields */ +static struct ptime_data *timenow; /* The time to use for checking at-fields */ #define DAYTIME_LEN 16 -char daytime[DAYTIME_LEN]; /* The current time in human readable form, - * used for rotation-tracking messages. */ -char hostname[MAXHOSTNAMELEN]; /* hostname */ +static char daytime[DAYTIME_LEN];/* The current time in human readable form, + * used for rotation-tracking messages. */ +static char hostname[MAXHOSTNAMELEN]; /* hostname */ -const char *path_syslogpid = _PATH_SYSLOGPID; +static const char *path_syslogpid = _PATH_SYSLOGPID; static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, diff --git a/usr.sbin/services_mkdb/Makefile b/usr.sbin/services_mkdb/Makefile index 659cdb8..e61c6df 100644 --- a/usr.sbin/services_mkdb/Makefile +++ b/usr.sbin/services_mkdb/Makefile @@ -2,7 +2,7 @@ PROG= services_mkdb MAN= services_mkdb.8 -SRCS= services_mkdb.c uniq.c +SRCS= services_mkdb.c uniq.c extern.h DPADD+= ${LIBUTIL} LDADD+= -lutil diff --git a/usr.sbin/services_mkdb/extern.h b/usr.sbin/services_mkdb/extern.h new file mode 100644 index 0000000..f0976ef --- /dev/null +++ b/usr.sbin/services_mkdb/extern.h @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +extern const HASHINFO hinfo; diff --git a/usr.sbin/services_mkdb/services_mkdb.c b/usr.sbin/services_mkdb/services_mkdb.c index f4cf62a..d81488c 100644 --- a/usr.sbin/services_mkdb/services_mkdb.c +++ b/usr.sbin/services_mkdb/services_mkdb.c @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <stringlist.h> +#include "extern.h" + static char tname[MAXPATHLEN]; #define PMASK 0xffff diff --git a/usr.sbin/services_mkdb/uniq.c b/usr.sbin/services_mkdb/uniq.c index 0674b4b..b6d06d4 100644 --- a/usr.sbin/services_mkdb/uniq.c +++ b/usr.sbin/services_mkdb/uniq.c @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include <ctype.h> #include <fcntl.h> -extern const HASHINFO hinfo; +#include "extern.h" void uniq(const char *); static int comp(const char *, char **, size_t *); |