summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-10-20 10:33:15 +0000
committered <ed@FreeBSD.org>2012-10-20 10:33:15 +0000
commitc23d2a42d74060bd07f9ee272b392868da7abea2 (patch)
tree27b346e0c9d07492d198e14e7d63aab1892e4ff2 /libexec
parente65c2d3d073186914cbb3ad3494d5da8b3bde8d5 (diff)
downloadFreeBSD-src-c23d2a42d74060bd07f9ee272b392868da7abea2.zip
FreeBSD-src-c23d2a42d74060bd07f9ee272b392868da7abea2.tar.gz
More -Wmissing-variable-declarations fixes.
In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rpc.rusersd/Makefile2
-rw-r--r--libexec/rpc.rusersd/extern.h38
-rw-r--r--libexec/rpc.rusersd/rusers_proc.c6
-rw-r--r--libexec/rpc.rusersd/rusersd.c2
-rw-r--r--libexec/talkd/announce.c2
-rw-r--r--libexec/talkd/extern.h3
-rw-r--r--libexec/talkd/process.c2
-rw-r--r--libexec/talkd/table.c5
-rw-r--r--libexec/talkd/talkd.c10
9 files changed, 52 insertions, 18 deletions
diff --git a/libexec/rpc.rusersd/Makefile b/libexec/rpc.rusersd/Makefile
index 6305343..df2be37 100644
--- a/libexec/rpc.rusersd/Makefile
+++ b/libexec/rpc.rusersd/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PROG = rpc.rusersd
-SRCS = rusersd.c rusers_proc.c
+SRCS = rusersd.c rusers_proc.c extern.h
MAN = rpc.rusersd.8
DPADD= ${LIBRPCSVC} ${LIBUTIL}
diff --git a/libexec/rpc.rusersd/extern.h b/libexec/rpc.rusersd/extern.h
new file mode 100644
index 0000000..b1a8309
--- /dev/null
+++ b/libexec/rpc.rusersd/extern.h
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 1993, John Brezak
+ * All rights reserved.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 int from_inetd;
+
+void rusers_service(struct svc_req *, SVCXPRT *);
diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c
index 6b34fa7..ff2ebc4 100644
--- a/libexec/rpc.rusersd/rusers_proc.c
+++ b/libexec/rpc.rusersd/rusers_proc.c
@@ -53,6 +53,8 @@ static const char rcsid[] =
#endif
#include <rpcsvc/rnusers.h>
+#include "extern.h"
+
#ifndef _PATH_DEV
#define _PATH_DEV "/dev"
#endif
@@ -61,10 +63,6 @@ static utmpidle utmp_idle[MAXUSERS];
static utmp old_utmp[MAXUSERS];
static struct utmpx utmp_list[MAXUSERS];
-extern int from_inetd;
-
-void rusers_service(struct svc_req *, SVCXPRT *);
-
#ifdef XIDLE
static Display *dpy;
diff --git a/libexec/rpc.rusersd/rusersd.c b/libexec/rpc.rusersd/rusersd.c
index 009bbfd..0ad4686 100644
--- a/libexec/rpc.rusersd/rusersd.c
+++ b/libexec/rpc.rusersd/rusersd.c
@@ -43,7 +43,7 @@ static const char rcsid[] =
#include <syslog.h>
#include <rpcsvc/rnusers.h>
-extern void rusers_service(struct svc_req *, SVCXPRT *);
+#include "extern.h"
int from_inetd = 1;
diff --git a/libexec/talkd/announce.c b/libexec/talkd/announce.c
index 869197e..83c96b7 100644
--- a/libexec/talkd/announce.c
+++ b/libexec/talkd/announce.c
@@ -60,8 +60,6 @@ static const char rcsid[] =
#include "ttymsg.h"
#include "extern.h"
-extern char hostname[];
-
/*
* Announce an invitation to talk.
*/
diff --git a/libexec/talkd/extern.h b/libexec/talkd/extern.h
index cb231a9..a91cb25 100644
--- a/libexec/talkd/extern.h
+++ b/libexec/talkd/extern.h
@@ -25,6 +25,9 @@
* $FreeBSD$
*/
+extern int debug;
+extern char hostname[];
+
int announce(CTL_MSG *, const char *);
int delete_invite(u_int32_t);
void do_announce(CTL_MSG *, CTL_RESPONSE *);
diff --git a/libexec/talkd/process.c b/libexec/talkd/process.c
index 18ddc42..1c5108f 100644
--- a/libexec/talkd/process.c
+++ b/libexec/talkd/process.c
@@ -63,8 +63,6 @@ static const char rcsid[] =
#include "extern.h"
-extern int debug;
-
void
process_request(CTL_MSG *mp, CTL_RESPONSE *rp)
{
diff --git a/libexec/talkd/table.c b/libexec/talkd/table.c
index dcaed9c..5ad7b61 100644
--- a/libexec/talkd/table.c
+++ b/libexec/talkd/table.c
@@ -64,8 +64,7 @@ static const char rcsid[] =
#define NIL ((TABLE_ENTRY *)0)
-extern int debug;
-struct timeval tp;
+static struct timeval tp;
typedef struct table_entry TABLE_ENTRY;
@@ -78,7 +77,7 @@ struct table_entry {
static void delete(TABLE_ENTRY *);
-TABLE_ENTRY *table = NIL;
+static TABLE_ENTRY *table = NIL;
/*
* Look in the table for an invitation that matches the current
diff --git a/libexec/talkd/talkd.c b/libexec/talkd/talkd.c
index e81cec6..56ce441 100644
--- a/libexec/talkd/talkd.c
+++ b/libexec/talkd/talkd.c
@@ -69,13 +69,13 @@ static const char rcsid[] =
#include "extern.h"
-CTL_MSG request;
-CTL_RESPONSE response;
+static CTL_MSG request;
+static CTL_RESPONSE response;
-int debug = 0;
-long lastmsgtime;
+int debug = 0;
+static long lastmsgtime;
-char hostname[MAXHOSTNAMELEN];
+char hostname[MAXHOSTNAMELEN];
#define TIMEOUT 30
#define MAXIDLE 120
OpenPOWER on IntegriCloud