From owner-svn-src-head@FreeBSD.ORG Thu Oct 25 20:16:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A063AB6B; Thu, 25 Oct 2012 20:16:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD3B8FC14; Thu, 25 Oct 2012 20:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9PKGdsD036906; Thu, 25 Oct 2012 20:16:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9PKGdxG036898; Thu, 25 Oct 2012 20:16:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201210252016.q9PKGdxG036898@svn.freebsd.org> From: Ed Schouten Date: Thu, 25 Oct 2012 20:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242091 - in head/usr.sbin/lpr: common_source filters X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2012 20:16:39 -0000 Author: ed Date: Thu Oct 25 20:16:38 2012 New Revision: 242091 URL: http://svn.freebsd.org/changeset/base/242091 Log: 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. Modified: head/usr.sbin/lpr/common_source/common.c head/usr.sbin/lpr/common_source/displayq.c head/usr.sbin/lpr/common_source/lp.h head/usr.sbin/lpr/common_source/net.c head/usr.sbin/lpr/common_source/rmjob.c head/usr.sbin/lpr/common_source/startdaemon.c head/usr.sbin/lpr/filters/lpf.c Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/common_source/common.c Thu Oct 25 20:16:38 2012 (r242091) @@ -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); /* Modified: head/usr.sbin/lpr/common_source/displayq.c ============================================================================== --- head/usr.sbin/lpr/common_source/displayq.c Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/common_source/displayq.c Thu Oct 25 20:16:38 2012 (r242091) @@ -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 */ Modified: head/usr.sbin/lpr/common_source/lp.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.h Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/common_source/lp.h Thu Oct 25 20:16:38 2012 (r242091) @@ -252,6 +252,9 @@ typedef enum { TR_SENDING, TR_RECVING, T /* * seteuid() macros. */ + +extern uid_t uid, euid; + #define PRIV_START { \ if (seteuid(euid) != 0) err(1, "seteuid failed"); \ } Modified: head/usr.sbin/lpr/common_source/net.c ============================================================================== --- head/usr.sbin/lpr/common_source/net.c Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/common_source/net.c Thu Oct 25 20:16:38 2012 (r242091) @@ -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. Modified: head/usr.sbin/lpr/common_source/rmjob.c ============================================================================== --- head/usr.sbin/lpr/common_source/rmjob.c Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/common_source/rmjob.c Thu Oct 25 20:16:38 2012 (r242091) @@ -69,8 +69,6 @@ static int all = 0; /* eliminate all fi 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); Modified: head/usr.sbin/lpr/common_source/startdaemon.c ============================================================================== --- head/usr.sbin/lpr/common_source/startdaemon.c Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/common_source/startdaemon.c Thu Oct 25 20:16:38 2012 (r242091) @@ -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. */ Modified: head/usr.sbin/lpr/filters/lpf.c ============================================================================== --- head/usr.sbin/lpr/filters/lpf.c Thu Oct 25 19:30:58 2012 (r242090) +++ head/usr.sbin/lpr/filters/lpf.c Thu Oct 25 20:16:38 2012 (r242091) @@ -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[])