summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-10-25 20:16:38 +0000
committered <ed@FreeBSD.org>2012-10-25 20:16:38 +0000
commit7a91df3c3792dc1bed5ff818447fc26896d809d1 (patch)
tree0e0428999efb2ba07c54e60bb09ad02a5f3c3bd6 /usr.sbin/lpr
parent534523d9751333936c4698628a7545f16b40d0c3 (diff)
downloadFreeBSD-src-7a91df3c3792dc1bed5ff818447fc26896d809d1.zip
FreeBSD-src-7a91df3c3792dc1bed5ff818447fc26896d809d1.tar.gz
Let lpr build with -Wmissing-variable-declarations.
Mark variables static where possible and place the uid/euid variables in lp.h, so that we can compile-time enforce that these variables have the same type.
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/common_source/common.c2
-rw-r--r--usr.sbin/lpr/common_source/displayq.c2
-rw-r--r--usr.sbin/lpr/common_source/lp.h3
-rw-r--r--usr.sbin/lpr/common_source/net.c2
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c2
-rw-r--r--usr.sbin/lpr/common_source/startdaemon.c2
-rw-r--r--usr.sbin/lpr/filters/lpf.c22
7 files changed, 14 insertions, 21 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c
index ce4a62d..93657d9 100644
--- a/usr.sbin/lpr/common_source/common.c
+++ b/usr.sbin/lpr/common_source/common.c
@@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$");
char line[BUFSIZ];
const char *progname; /* program name */
-extern uid_t uid, euid;
-
static int compar(const void *_p1, const void *_p2);
/*
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index b4bd7ce..3c038d6 100644
--- a/usr.sbin/lpr/common_source/displayq.c
+++ b/usr.sbin/lpr/common_source/displayq.c
@@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$");
/*
* Stuff for handling job specifications
*/
-extern uid_t uid, euid;
-
static int col; /* column on screen */
static char current[MAXNAMLEN+1]; /* current file being printed */
static char file[MAXNAMLEN+1]; /* print file name */
diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h
index 9014ee0..fb05d2f 100644
--- a/usr.sbin/lpr/common_source/lp.h
+++ b/usr.sbin/lpr/common_source/lp.h
@@ -252,6 +252,9 @@ typedef enum { TR_SENDING, TR_RECVING, TR_PRINTING } tr_sendrecv;
/*
* seteuid() macros.
*/
+
+extern uid_t uid, euid;
+
#define PRIV_START { \
if (seteuid(euid) != 0) err(1, "seteuid failed"); \
}
diff --git a/usr.sbin/lpr/common_source/net.c b/usr.sbin/lpr/common_source/net.c
index 0ac816a..ab6fa16 100644
--- a/usr.sbin/lpr/common_source/net.c
+++ b/usr.sbin/lpr/common_source/net.c
@@ -80,8 +80,6 @@ u_char family = PF_UNSPEC;
u_char family = PF_INET;
#endif
-extern uid_t uid, euid;
-
/*
* Create a TCP connection to host "rhost" at port "rport".
* If rport == 0, then use the printer service port.
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index d0327a2..c89a6f0 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -69,8 +69,6 @@ static int all = 0; /* eliminate all files (root only) */
static int cur_daemon; /* daemon's pid */
static char current[7+MAXHOSTNAMELEN]; /* active control file name */
-extern uid_t uid, euid; /* real and effective user id's */
-
static void alarmhandler(int _signo);
static void do_unlink(char *_file);
static int isowner(char *_owner, char *_file, const char *_cfhost);
diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c
index a1398bb..8e4f60a 100644
--- a/usr.sbin/lpr/common_source/startdaemon.c
+++ b/usr.sbin/lpr/common_source/startdaemon.c
@@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$");
#include "lp.h"
#include "pathnames.h"
-extern uid_t uid, euid;
-
/*
* Tell the printer daemon that there are new files in the spool directory.
*/
diff --git a/usr.sbin/lpr/filters/lpf.c b/usr.sbin/lpr/filters/lpf.c
index b277d17..f8ffe52 100644
--- a/usr.sbin/lpr/filters/lpf.c
+++ b/usr.sbin/lpr/filters/lpf.c
@@ -60,17 +60,17 @@ __FBSDID("$FreeBSD$");
#define MAXWIDTH 132
#define MAXREP 10
-char buf[MAXREP][MAXWIDTH];
-int maxcol[MAXREP] = {-1};
-int lineno;
-int width = 132; /* default line length */
-int length = 66; /* page length */
-int indent; /* indentation length */
-int npages = 1;
-int literal; /* print control characters */
-char *name; /* user's login name */
-char *host; /* user's machine name */
-char *acctfile; /* accounting information file */
+static char buf[MAXREP][MAXWIDTH];
+static int maxcol[MAXREP] = {-1};
+static int lineno;
+static int width = 132; /* default line length */
+static int length = 66; /* page length */
+static int indent; /* indentation length */
+static int npages = 1;
+static int literal; /* print control characters */
+static char *name; /* user's login name */
+static char *host; /* user's machine name */
+static char *acctfile; /* accounting information file */
int
main(int argc, char *argv[])
OpenPOWER on IntegriCloud