svn commit: r227151 - in head/sys: conf kern

2011-11-06 Thread Max Khon
Author: fjoe
Date: Sun Nov  6 08:10:41 2011
New Revision: 227151
URL: http://svn.freebsd.org/changeset/base/227151

Log:
  Add KLD_DEBUG option.

Modified:
  head/sys/conf/options
  head/sys/kern/kern_linker.c

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Sun Nov  6 08:03:33 2011(r227150)
+++ head/sys/conf/options   Sun Nov  6 08:10:41 2011(r227151)
@@ -59,6 +59,7 @@ GDB
 KDBopt_global.h
 KDB_TRACE  opt_kdb.h
 KDB_UNATTENDED opt_kdb.h
+KLD_DEBUG  opt_kld.h
 SYSCTL_DEBUG   opt_sysctl.h
 
 # Miscellaneous options.

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Sun Nov  6 08:03:33 2011(r227150)
+++ head/sys/kern/kern_linker.c Sun Nov  6 08:10:41 2011(r227151)
@@ -28,6 +28,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ddb.h"
+#include "opt_kld.h"
 #include "opt_hwpmc_hooks.h"
 
 #include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227152 - head/usr.bin/banner

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:13:51 2011
New Revision: 227152
URL: http://svn.freebsd.org/changeset/base/227152

Log:
  Add missing static keywords to banner(1)

Modified:
  head/usr.bin/banner/banner.c

Modified: head/usr.bin/banner/banner.c
==
--- head/usr.bin/banner/banner.cSun Nov  6 08:10:41 2011
(r227151)
+++ head/usr.bin/banner/banner.cSun Nov  6 08:13:51 2011
(r227152)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #define NBYTES 9271
 
 /* Pointers into data_table for each ASCII char */
-const int asc_ptr[NCHARS] = {
+static const int asc_ptr[NCHARS] = {
 /* ^@ */   0,  0,  0,  0,  0,  0,  0,  0,
 /* ^H */   0,  0,  0,  0,  0,  0,  0,  0,
 /* ^P */   0,  0,  0,  0,  0,  0,  0,  0,
@@ -86,7 +86,7 @@ const int asc_ptr[NCHARS] = {
  * is the next elt in array) and goto second
  * next element in array.
  */
-const unsigned char data_table[NBYTES] = {
+static const unsigned char data_table[NBYTES] = {
 /* 0 1 2 3 4 5 6 7 8 9 */
 /*0 */   129,  227,  130,   34,6,   90,   19,  129,   32,   10,
 /*   10 */74,   40,  129,   31,   12,   64,   53,  129,   30,   14,
@@ -1018,11 +1018,11 @@ const unsigned char data_table[NBYTES] =
 /* 9270 */   193
 };
 
-char   line[DWIDTH];
-char   *message;
-char   print[DWIDTH];
-intdebug, i, j, linen, max, nchars, pc, term, trace, x, y;
-intwidth = DWIDTH; /* -w option: scrunch letters to 80 columns */
+static charline[DWIDTH];
+static char*message;
+static charprint[DWIDTH];
+static int debug, i, j, linen, max, nchars, pc, term, trace, x, y;
+static int width = DWIDTH; /* -w option: scrunch letters to 80 columns */
 
 static void usage(void);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227153 - head/usr.bin/c99

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:13:58 2011
New Revision: 227153
URL: http://svn.freebsd.org/changeset/base/227153

Log:
  Add missing static keywords to c99(1)

Modified:
  head/usr.bin/c99/c99.c

Modified: head/usr.bin/c99/c99.c
==
--- head/usr.bin/c99/c99.c  Sun Nov  6 08:13:51 2011(r227152)
+++ head/usr.bin/c99/c99.c  Sun Nov  6 08:13:58 2011(r227153)
@@ -43,12 +43,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-char **args;
-u_int cargs, nargs;
+static char **args;
+static u_int cargs, nargs;
 
-void addarg(const char *);
-void addlib(const char *);
-void usage(void);
+static void addarg(const char *);
+static void addlib(const char *);
+static void usage(void);
 
 int
 main(int argc, char *argv[])
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
err(1, "/usr/bin/cc");
 }
 
-void
+static void
 addarg(const char *item)
 {
if (nargs + 1 >= cargs) {
@@ -104,7 +104,7 @@ addarg(const char *item)
args[nargs] = NULL;
 }
 
-void
+static void
 addlib(const char *lib)
 {
 
@@ -123,7 +123,7 @@ addlib(const char *lib)
}
 }
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr, "%s\n%s\n",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227154 - head/usr.bin/cap_mkdb

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:03 2011
New Revision: 227154
URL: http://svn.freebsd.org/changeset/base/227154

Log:
  Add missing static keywords to cap_mkdb(1)

Modified:
  head/usr.bin/cap_mkdb/cap_mkdb.c

Modified: head/usr.bin/cap_mkdb/cap_mkdb.c
==
--- head/usr.bin/cap_mkdb/cap_mkdb.cSun Nov  6 08:13:58 2011
(r227153)
+++ head/usr.bin/cap_mkdb/cap_mkdb.cSun Nov  6 08:14:03 2011
(r227154)
@@ -53,15 +53,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-voiddb_build(char **);
-voiddounlink(void);
-voidusage(void);
-
-DB *capdbp;
-int verbose;
-char *capdb, *capname, buf[8 * 1024];
+static void db_build(char **);
+static void dounlink(void);
+static void usage(void);
+
+static DB  *capdbp;
+static int  verbose;
+static char*capname, buf[8 * 1024];
 
-HASHINFO openinfo = {
+static HASHINFO openinfo = {
4096,   /* bsize */
0,  /* ffactor */
0,  /* nelem */
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
exit(0);
 }
 
-void
+static void
 dounlink(void)
 {
if (capname != NULL)
@@ -153,7 +153,7 @@ dounlink(void)
  * Db_build() builds the name and capability databases according to the
  * details above.
  */
-void
+static void
 db_build(char **ifiles)
 {
DBT key, data;
@@ -259,7 +259,7 @@ db_build(char **ifiles)
(void)printf("cap_mkdb: %d capability records\n", reccnt);
 }
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227157 - head/usr.bin/col

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:22 2011
New Revision: 227157
URL: http://svn.freebsd.org/changeset/base/227157

Log:
  Add missing static keywords to col(1)

Modified:
  head/usr.bin/col/col.c

Modified: head/usr.bin/col/col.c
==
--- head/usr.bin/col/col.c  Sun Nov  6 08:14:16 2011(r227156)
+++ head/usr.bin/col/col.c  Sun Nov  6 08:14:22 2011(r227157)
@@ -92,22 +92,22 @@ struct line_str {
int l_max_col;  /* max column in the line */
 };
 
-LINE   *alloc_line(void);
-void   dowarn(int);
-void   flush_line(LINE *);
-void   flush_lines(int);
-void   flush_blanks(void);
-void   free_line(LINE *);
-void   usage(void);
-
-CSET   last_set;   /* char_set of last char printed */
-LINE   *lines;
-intcompress_spaces;/* if doing space -> tab conversion */
-intfine;   /* if `fine' resolution (half lines) */
-intmax_bufd_lines; /* max # lines to keep in memory */
-intnblank_lines;   /* # blanks after last flushed line */
-intno_backspaces;  /* if not to output any backspaces */
-intpass_unknown_seqs;  /* pass unknown control sequences */
+static LINE   *alloc_line(void);
+static voiddowarn(int);
+static voidflush_line(LINE *);
+static voidflush_lines(int);
+static voidflush_blanks(void);
+static voidfree_line(LINE *);
+static voidusage(void);
+
+static CSETlast_set;   /* char_set of last char printed */
+static LINE*lines;
+static int compress_spaces;/* if doing space -> tab conversion */
+static int fine;   /* if `fine' resolution (half lines) */
+static int max_bufd_lines; /* max # lines to keep in memory */
+static int nblank_lines;   /* # blanks after last flushed line */
+static int no_backspaces;  /* if not to output any backspaces */
+static int pass_unknown_seqs;  /* pass unknown control sequences */
 
 #definePUTC(ch) \
do {\
@@ -334,7 +334,7 @@ main(int argc, char **argv)
exit(0);
 }
 
-void
+static void
 flush_lines(int nflush)
 {
LINE *l;
@@ -360,7 +360,7 @@ flush_lines(int nflush)
  * is the number of half line feeds, otherwise it is the number of whole line
  * feeds.
  */
-void
+static void
 flush_blanks(void)
 {
int half, i, nb;
@@ -389,7 +389,7 @@ flush_blanks(void)
  * Write a line to stdout taking care of space to tab conversion (-h flag)
  * and character set shifts.
  */
-void
+static void
 flush_line(LINE *l)
 {
CHAR *c, *endc;
@@ -502,7 +502,7 @@ flush_line(LINE *l)
 
 static LINE *line_freelist;
 
-LINE *
+static LINE *
 alloc_line(void)
 {
LINE *l;
@@ -523,7 +523,7 @@ alloc_line(void)
return (l);
 }
 
-void
+static void
 free_line(LINE *l)
 {
 
@@ -531,7 +531,7 @@ free_line(LINE *l)
line_freelist = l;
 }
 
-void
+static void
 usage(void)
 {
 
@@ -539,7 +539,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 dowarn(int line)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227158 - head/usr.bin/colcrt

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:28 2011
New Revision: 227158
URL: http://svn.freebsd.org/changeset/base/227158

Log:
  Add missing static keywords to colcrt(1)

Modified:
  head/usr.bin/colcrt/colcrt.c

Modified: head/usr.bin/colcrt/colcrt.c
==
--- head/usr.bin/colcrt/colcrt.cSun Nov  6 08:14:22 2011
(r227157)
+++ head/usr.bin/colcrt/colcrt.cSun Nov  6 08:14:28 2011
(r227158)
@@ -64,13 +64,13 @@ __FBSDID("$FreeBSD$");
  * Option -2 forces printing of all half lines.
  */
 
-wchar_tpage[267][132];
+static wchar_t page[267][132];
 
-intoutline = 1;
-intoutcol;
+static int outline = 1;
+static int outcol;
 
-char   suppresul;
-char   printall;
+static charsuppresul;
+static charprintall;
 
 static voidmove(int, int);
 static voidpflush(int);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227159 - head/usr.bin/column

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:34 2011
New Revision: 227159
URL: http://svn.freebsd.org/changeset/base/227159

Log:
  Add missing static keywords to column(1)

Modified:
  head/usr.bin/column/column.c

Modified: head/usr.bin/column/column.c
==
--- head/usr.bin/column/column.cSun Nov  6 08:14:28 2011
(r227158)
+++ head/usr.bin/column/column.cSun Nov  6 08:14:34 2011
(r227159)
@@ -58,21 +58,21 @@ __FBSDID("$FreeBSD$");
 
 #defineTAB 8
 
-void  c_columnate(void);
-void  input(FILE *);
-void  maketbl(void);
-void  print(void);
-void  r_columnate(void);
-void  usage(void);
-int   width(const wchar_t *);
-
-int termwidth = 80;/* default terminal width */
-
-int entries;   /* number of records */
-int eval;  /* exit value */
-int maxlength; /* longest record */
-wchar_t **list;/* array of pointers to records */
-const wchar_t *separator = L"\t "; /* field separator for table option */
+static voidc_columnate(void);
+static voidinput(FILE *);
+static voidmaketbl(void);
+static voidprint(void);
+static voidr_columnate(void);
+static voidusage(void);
+static int width(const wchar_t *);
+
+static int termwidth = 80; /* default terminal width */
+
+static int entries;/* number of records */
+static int eval;   /* exit value */
+static int maxlength;  /* longest record */
+static wchar_t **list; /* array of pointers to records */
+static const wchar_t *separator = L"\t "; /* field separator for table option 
*/
 
 int
 main(int argc, char **argv)
@@ -149,7 +149,7 @@ main(int argc, char **argv)
exit(eval);
 }
 
-void
+static void
 c_columnate(void)
 {
int chcnt, col, cnt, endcol, numcols;
@@ -178,7 +178,7 @@ c_columnate(void)
putwchar('\n');
 }
 
-void
+static void
 r_columnate(void)
 {
int base, chcnt, cnt, col, endcol, numcols, numrows, row;
@@ -205,7 +205,7 @@ r_columnate(void)
}
 }
 
-void
+static void
 print(void)
 {
int cnt;
@@ -221,7 +221,7 @@ typedef struct _tbl {
 } TBL;
 #defineDEFCOLS 25
 
-void
+static void
 maketbl(void)
 {
TBL *t;
@@ -274,7 +274,7 @@ maketbl(void)
 #defineDEFNUM  1000
 #defineMAXLINELEN  (LINE_MAX + 1)
 
-void
+static void
 input(FILE *fp)
 {
static int maxentry;
@@ -313,7 +313,7 @@ input(FILE *fp)
 }
 
 /* Like wcswidth(), but ignores non-printing characters. */
-int
+static int
 width(const wchar_t *wcs)
 {
int w, cw;
@@ -324,7 +324,7 @@ width(const wchar_t *wcs)
return (w);
 }
 
-void
+static void
 usage(void)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227161 - head/usr.bin/csplit

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:45 2011
New Revision: 227161
URL: http://svn.freebsd.org/changeset/base/227161

Log:
  Add missing static keywords to csplit(1)

Modified:
  head/usr.bin/csplit/csplit.c

Modified: head/usr.bin/csplit/csplit.c
==
--- head/usr.bin/csplit/csplit.cSun Nov  6 08:14:40 2011
(r227160)
+++ head/usr.bin/csplit/csplit.cSun Nov  6 08:14:45 2011
(r227161)
@@ -60,36 +60,36 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-voidcleanup(void);
-voiddo_lineno(const char *);
-voiddo_rexp(const char *);
-char   *getline(void);
-voidhandlesig(int);
-FILE   *newfile(void);
-voidtoomuch(FILE *, long);
-voidusage(void);
+static void cleanup(void);
+static void do_lineno(const char *);
+static void do_rexp(const char *);
+static char*getline(void);
+static void handlesig(int);
+static FILE*newfile(void);
+static void toomuch(FILE *, long);
+static void usage(void);
 
 /*
  * Command line options
  */
-const char *prefix;/* File name prefix */
-longsufflen;   /* Number of decimal digits for suffix */
-int sflag; /* Suppress output of file names */
-int kflag; /* Keep output if error occurs */
+static const char *prefix; /* File name prefix */
+static long sufflen;   /* Number of decimal digits for suffix */
+static int  sflag; /* Suppress output of file names */
+static int  kflag; /* Keep output if error occurs */
 
 /*
  * Other miscellaneous globals (XXX too many)
  */
-longlineno;/* Current line number in input file */
-longreps;  /* Number of repetitions for this pattern */
-longnfiles;/* Number of files output so far */
-longmaxfiles;  /* Maximum number of files we can create */
-charcurrfile[PATH_MAX];/* Current output file */
-const char *infn;  /* Name of the input file */
-FILE   *infile;/* Input file handle */
-FILE   *overfile;  /* Overflow file for toomuch() */
-off_t   truncofs;  /* Offset this file should be truncated at */
-int doclean;   /* Should cleanup() remove output? */
+static long lineno;/* Current line number in input file */
+static long reps;  /* Number of repetitions for this pattern */
+static long nfiles;/* Number of files output so far */
+static long maxfiles;  /* Maximum number of files we can create */
+static char currfile[PATH_MAX]; /* Current output file */
+static const char *infn;   /* Name of the input file */
+static FILE*infile;/* Input file handle */
+static FILE*overfile;  /* Overflow file for toomuch() */
+static off_ttruncofs;  /* Offset this file should be truncated at */
+static int  doclean;   /* Should cleanup() remove output? */
 
 int
 main(int argc, char *argv[])
@@ -209,7 +209,7 @@ main(int argc, char *argv[])
return (0);
 }
 
-void
+static void
 usage(void)
 {
 
@@ -218,7 +218,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 handlesig(int sig __unused)
 {
const char msg[] = "csplit: caught signal, cleaning up\n";
@@ -229,7 +229,7 @@ handlesig(int sig __unused)
 }
 
 /* Create a new output file. */
-FILE *
+static FILE *
 newfile(void)
 {
FILE *fp;
@@ -245,7 +245,7 @@ newfile(void)
 }
 
 /* Remove partial output, called before exiting. */
-void
+static void
 cleanup(void)
 {
char fnbuf[PATH_MAX];
@@ -269,7 +269,7 @@ cleanup(void)
 }
 
 /* Read a line from the input into a static buffer. */
-char *
+static char *
 getline(void)
 {
static char lbuf[LINE_MAX];
@@ -292,7 +292,7 @@ again: if (fgets(lbuf, sizeof(lbuf), src
 }
 
 /* Conceptually rewind the input (as obtained by getline()) back `n' lines. */
-void
+static void
 toomuch(FILE *ofp, long n)
 {
char buf[BUFSIZ];
@@ -351,7 +351,7 @@ toomuch(FILE *ofp, long n)
 }
 
 /* Handle splits for /regexp/ and %regexp% patterns. */
-void
+static void
 do_rexp(const char *expr)
 {
regex_t cre;
@@ -433,7 +433,7 @@ do_rexp(const char *expr)
 }
 
 /* Handle splits based on line number. */
-void
+static void
 do_lineno(const char *expr)
 {
long lastline, tgtline;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227155 - head/usr.bin/catman

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:09 2011
New Revision: 227155
URL: http://svn.freebsd.org/changeset/base/227155

Log:
  Add missing static keywords to catman(1)

Modified:
  head/usr.bin/catman/catman.c

Modified: head/usr.bin/catman/catman.c
==
--- head/usr.bin/catman/catman.cSun Nov  6 08:14:03 2011
(r227154)
+++ head/usr.bin/catman/catman.cSun Nov  6 08:14:09 2011
(r227155)
@@ -94,7 +94,7 @@ enum Ziptype {NONE, BZIP, GZIP};
 static uid_t uid;
 static int starting_dir;
 static char tmp_file[MAXPATHLEN];
-struct stat test_st;
+static struct stat test_st;
 
 /*
  * A hashtable is an array of chains composed of this entry structure.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227156 - head/usr.bin/cmp

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:16 2011
New Revision: 227156
URL: http://svn.freebsd.org/changeset/base/227156

Log:
  Add missing static keywords to cmp(1)

Modified:
  head/usr.bin/cmp/extern.h

Modified: head/usr.bin/cmp/extern.h
==
--- head/usr.bin/cmp/extern.h   Sun Nov  6 08:14:09 2011(r227155)
+++ head/usr.bin/cmp/extern.h   Sun Nov  6 08:14:16 2011(r227156)
@@ -42,4 +42,4 @@ void  c_special(int, const char *, off_t,
 void   diffmsg(const char *, const char *, off_t, off_t);
 void   eofmsg(const char *);
 
-extern int lflag, sflag, xflag;
+extern int lflag, sflag, xflag, zflag;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227160 - head/usr.bin/cpuset

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:40 2011
New Revision: 227160
URL: http://svn.freebsd.org/changeset/base/227160

Log:
  Add missing static keywords to cpuset(1)

Modified:
  head/usr.bin/cpuset/cpuset.c

Modified: head/usr.bin/cpuset/cpuset.c
==
--- head/usr.bin/cpuset/cpuset.cSun Nov  6 08:14:34 2011
(r227159)
+++ head/usr.bin/cpuset/cpuset.cSun Nov  6 08:14:40 2011
(r227160)
@@ -46,22 +46,22 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-int Cflag;
-int cflag;
-int gflag;
-int iflag;
-int jflag;
-int lflag;
-int pflag;
-int rflag;
-int sflag;
-int tflag;
-int xflag;
-id_t id;
-cpulevel_t level;
-cpuwhich_t which;
+static int Cflag;
+static int cflag;
+static int gflag;
+static int iflag;
+static int jflag;
+static int lflag;
+static int pflag;
+static int rflag;
+static int sflag;
+static int tflag;
+static int xflag;
+static id_t id;
+static cpulevel_t level;
+static cpuwhich_t which;
 
-void usage(void);
+static void usage(void);
 
 static void printset(cpuset_t *mask);
 
@@ -161,8 +161,8 @@ printset(cpuset_t *mask)
printf("\n");
 }
 
-const char *whichnames[] = { NULL, "tid", "pid", "cpuset", "irq", "jail" };
-const char *levelnames[] = { NULL, " root", " cpuset", "" };
+static const char *whichnames[] = { NULL, "tid", "pid", "cpuset", "irq", 
"jail" };
+static const char *levelnames[] = { NULL, " root", " cpuset", "" };
 
 static void
 printaffinity(void)
@@ -343,7 +343,7 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
 }
 
-void
+static void
 usage(void)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227162 - head/usr.bin/cut

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:51 2011
New Revision: 227162
URL: http://svn.freebsd.org/changeset/base/227162

Log:
  Add missing static keywords to cut(1)

Modified:
  head/usr.bin/cut/cut.c

Modified: head/usr.bin/cut/cut.c
==
--- head/usr.bin/cut/cut.c  Sun Nov  6 08:14:45 2011(r227161)
+++ head/usr.bin/cut/cut.c  Sun Nov  6 08:14:51 2011(r227162)
@@ -50,25 +50,25 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-intbflag;
-intcflag;
-wchar_tdchar;
-char   dcharmb[MB_LEN_MAX + 1];
-intdflag;
-intfflag;
-intnflag;
-intsflag;
-
-size_t autostart, autostop, maxval;
-char * positions;
-
-intb_cut(FILE *, const char *);
-intb_n_cut(FILE *, const char *);
-intc_cut(FILE *, const char *);
-intf_cut(FILE *, const char *);
-void   get_list(char *);
-void   needpos(size_t);
-static void usage(void);
+static int bflag;
+static int cflag;
+static wchar_t dchar;
+static chardcharmb[MB_LEN_MAX + 1];
+static int dflag;
+static int fflag;
+static int nflag;
+static int sflag;
+
+static size_t  autostart, autostop, maxval;
+static char *  positions;
+
+static int b_cut(FILE *, const char *);
+static int b_n_cut(FILE *, const char *);
+static int c_cut(FILE *, const char *);
+static int f_cut(FILE *, const char *);
+static voidget_list(char *);
+static voidneedpos(size_t);
+static voidusage(void);
 
 int
 main(int argc, char *argv[])
@@ -153,7 +153,7 @@ main(int argc, char *argv[])
exit(rval);
 }
 
-void
+static void
 get_list(char *list)
 {
size_t setautostart, start, stop;
@@ -208,7 +208,7 @@ get_list(char *list)
memset(positions + 1, '1', autostart);
 }
 
-void
+static void
 needpos(size_t n)
 {
static size_t npos;
@@ -227,7 +227,7 @@ needpos(size_t n)
}
 }
 
-int
+static int
 b_cut(FILE *fp, const char *fname __unused)
 {
int ch, col;
@@ -261,7 +261,7 @@ b_cut(FILE *fp, const char *fname __unus
  * Although this function also handles the case where -n is not specified,
  * b_cut() ought to be much faster.
  */
-int
+static int
 b_n_cut(FILE *fp, const char *fname)
 {
size_t col, i, lbuflen;
@@ -323,7 +323,7 @@ b_n_cut(FILE *fp, const char *fname)
return (warned);
 }
 
-int
+static int
 c_cut(FILE *fp, const char *fname)
 {
wint_t ch;
@@ -358,7 +358,7 @@ out:
return (0);
 }
 
-int
+static int
 f_cut(FILE *fp, const char *fname)
 {
wchar_t ch;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227163 - head/usr.bin/dc

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:14:57 2011
New Revision: 227163
URL: http://svn.freebsd.org/changeset/base/227163

Log:
  Add missing static keywords to dc(1)

Modified:
  head/usr.bin/dc/dc.c

Modified: head/usr.bin/dc/dc.c
==
--- head/usr.bin/dc/dc.cSun Nov  6 08:14:51 2011(r227162)
+++ head/usr.bin/dc/dc.cSun Nov  6 08:14:57 2011(r227163)
@@ -39,9 +39,9 @@ static voidusage(void);
 
 extern char*__progname;
 
-struct source   src;
+static struct sourcesrc;
 
-struct option long_options[] =
+static const struct option long_options[] =
 {
{"expression",  required_argument,  NULL,   'e'},
{"file",required_argument,  NULL,   'f'},
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227164 - head/usr.bin/du

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:17 2011
New Revision: 227164
URL: http://svn.freebsd.org/changeset/base/227164

Log:
  Add missing static keywords to du(1)

Modified:
  head/usr.bin/du/du.c

Modified: head/usr.bin/du/du.c
==
--- head/usr.bin/du/du.cSun Nov  6 08:14:57 2011(r227163)
+++ head/usr.bin/du/du.cSun Nov  6 08:15:17 2011(r227164)
@@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-SLIST_HEAD(ignhead, ignentry) ignores;
+static SLIST_HEAD(ignhead, ignentry) ignores;
 struct ignentry {
char*mask;
SLIST_ENTRY(ignentry)   next;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227166 - head/usr.bin/id

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:30 2011
New Revision: 227166
URL: http://svn.freebsd.org/changeset/base/227166

Log:
  Add missing static keywords to id(1)

Modified:
  head/usr.bin/id/id.c

Modified: head/usr.bin/id/id.c
==
--- head/usr.bin/id/id.cSun Nov  6 08:15:23 2011(r227165)
+++ head/usr.bin/id/id.cSun Nov  6 08:15:30 2011(r227166)
@@ -57,16 +57,16 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-void   id_print(struct passwd *, int, int, int);
-void   pline(struct passwd *);
-void   pretty(struct passwd *);
-void   auditid(void);
-void   group(struct passwd *, int);
-void   maclabel(void);
-void   usage(void);
-struct passwd *who(char *);
+static voidid_print(struct passwd *, int, int, int);
+static voidpline(struct passwd *);
+static voidpretty(struct passwd *);
+static voidauditid(void);
+static voidgroup(struct passwd *, int);
+static voidmaclabel(void);
+static voidusage(void);
+static struct passwd *who(char *);
 
-int isgroups, iswhoami;
+static int isgroups, iswhoami;
 
 int
 main(int argc, char *argv[])
@@ -220,7 +220,7 @@ main(int argc, char *argv[])
exit(0);
 }
 
-void
+static void
 pretty(struct passwd *pw)
 {
struct group *gr;
@@ -260,7 +260,7 @@ pretty(struct passwd *pw)
}
 }
 
-void
+static void
 id_print(struct passwd *pw, int use_ggl, int p_euid, int p_egid)
 {
struct group *gr;
@@ -324,7 +324,7 @@ id_print(struct passwd *pw, int use_ggl,
 }
 
 #ifdef USE_BSM_AUDIT
-void
+static void
 auditid(void)
 {
auditinfo_t auditinfo;
@@ -371,7 +371,7 @@ auditid(void)
 }
 #endif
 
-void
+static void
 group(struct passwd *pw, int nflag)
 {
struct group *gr;
@@ -411,7 +411,7 @@ group(struct passwd *pw, int nflag)
free(groups);
 }
 
-void
+static void
 maclabel(void)
 {
char *string;
@@ -435,7 +435,7 @@ maclabel(void)
free(string);
 }
 
-struct passwd *
+static struct passwd *
 who(char *u)
 {
struct passwd *pw;
@@ -455,7 +455,7 @@ who(char *u)
/* NOTREACHED */
 }
 
-void
+static void
 pline(struct passwd *pw)
 {
 
@@ -471,7 +471,7 @@ pline(struct passwd *pw)
 }
 
 
-void
+static void
 usage(void)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227167 - head/usr.bin/join

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:35 2011
New Revision: 227167
URL: http://svn.freebsd.org/changeset/base/227167

Log:
  Add missing static keywords to join(1)

Modified:
  head/usr.bin/join/join.c

Modified: head/usr.bin/join/join.c
==
--- head/usr.bin/join/join.cSun Nov  6 08:15:30 2011(r227166)
+++ head/usr.bin/join/join.cSun Nov  6 08:15:35 2011(r227167)
@@ -83,36 +83,36 @@ typedef struct {
u_long setcnt;  /* set count */
u_long setalloc;/* set allocated count */
 } INPUT;
-INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 },
-  input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 };
+static INPUT input1 = { NULL, 0, 0, 1, NULL, 0, 0, 0, 0 },
+input2 = { NULL, 0, 0, 2, NULL, 0, 0, 0, 0 };
 
 typedef struct {
u_long  filenum;/* file number */
u_long  fieldno;/* field number */
 } OLIST;
-OLIST *olist;  /* output field list */
-u_long olistcnt;   /* output field list count */
-u_long olistalloc; /* output field allocated count */
-
-int joinout = 1;   /* show lines with matched join fields (-v) */
-int needsep;   /* need separator character */
-int spans = 1; /* span multiple delimiters (-t) */
-char *empty;   /* empty field replacement string (-e) */
+static OLIST *olist;   /* output field list */
+static u_long olistcnt;/* output field list count */
+static u_long olistalloc;  /* output field allocated count */
+
+static int joinout = 1;/* show lines with matched join fields 
(-v) */
+static int needsep;/* need separator character */
+static int spans = 1;  /* span multiple delimiters (-t) */
+static char *empty;/* empty field replacement string (-e) */
 static wchar_t default_tabchar[] = L" \t";
-wchar_t *tabchar = default_tabchar;/* delimiter characters (-t) */
+static wchar_t *tabchar = default_tabchar; /* delimiter characters (-t) */
 
-int  cmp(LINE *, u_long, LINE *, u_long);
-void fieldarg(char *);
-void joinlines(INPUT *, INPUT *);
-int  mbscoll(const char *, const char *);
-char *mbssep(char **, const wchar_t *);
-void obsolete(char **);
-void outfield(LINE *, u_long, int);
-void outoneline(INPUT *, LINE *);
-void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
-void slurp(INPUT *);
-wchar_t *towcs(const char *);
-void usage(void);
+static int  cmp(LINE *, u_long, LINE *, u_long);
+static void fieldarg(char *);
+static void joinlines(INPUT *, INPUT *);
+static int  mbscoll(const char *, const char *);
+static char *mbssep(char **, const wchar_t *);
+static void obsolete(char **);
+static void outfield(LINE *, u_long, int);
+static void outoneline(INPUT *, LINE *);
+static void outtwoline(INPUT *, LINE *, INPUT *, LINE *);
+static void slurp(INPUT *);
+static wchar_t *towcs(const char *);
+static void usage(void);
 
 int
 main(int argc, char *argv[])
@@ -270,7 +270,7 @@ main(int argc, char *argv[])
exit(0);
 }
 
-void
+static void
 slurp(INPUT *F)
 {
LINE *lp, *lastlp, tmp;
@@ -359,7 +359,7 @@ slurp(INPUT *F)
}
 }
 
-char *
+static char *
 mbssep(char **stringp, const wchar_t *delim)
 {
char *s, *tok;
@@ -388,7 +388,7 @@ mbssep(char **stringp, const wchar_t *de
}
 }
 
-int
+static int
 cmp(LINE *lp1, u_long fieldno1, LINE *lp2, u_long fieldno2)
 {
if (lp1->fieldcnt <= fieldno1)
@@ -398,7 +398,7 @@ cmp(LINE *lp1, u_long fieldno1, LINE *lp
return (mbscoll(lp1->fields[fieldno1], lp2->fields[fieldno2]));
 }
 
-int
+static int
 mbscoll(const char *s1, const char *s2)
 {
wchar_t *w1, *w2;
@@ -414,7 +414,7 @@ mbscoll(const char *s1, const char *s2)
return (ret);
 }
 
-wchar_t *
+static wchar_t *
 towcs(const char *s)
 {
wchar_t *wcs;
@@ -428,7 +428,7 @@ towcs(const char *s)
return (wcs);
 }
 
-void
+static void
 joinlines(INPUT *F1, INPUT *F2)
 {
u_long cnt1, cnt2;
@@ -448,7 +448,7 @@ joinlines(INPUT *F1, INPUT *F2)
outtwoline(F1, &F1->set[cnt1], F2, &F2->set[cnt2]);
 }
 
-void
+static void
 outoneline(INPUT *F, LINE *lp)
 {
u_long cnt;
@@ -476,7 +476,7 @@ outoneline(INPUT *F, LINE *lp)
needsep = 0;
 }
 
-void
+static void
 outtwoline(INPUT *F1, LINE *lp1, INPUT *F2, LINE *lp2)
 {
u_long cnt;
@@ -512,7 +512,7 @@ outtwoline(INPUT *F1, LINE *lp1, INPUT *
needsep = 0;
 }
 
-void
+static void
 outfield(LINE *lp, u_long fieldno, int out_empty)
 {
if (needsep++)
@@ -535,7 +535,7 @@ outfield(LINE *lp, u_long fieldno, int o
  * Convert an output list argument "2.1, 1.3, 2.4" into an array of output
  * fields.
  */
-void
+static void
 fieldarg(char *option)
 {
u_long fieldno, filenum;
@@ -569,7 +569,7 @@ fieldarg(char *option)
}
 }
 
-void
+static void
 obsolete(char **argv)
 {
size_t len;
@@ -654,7 

svn commit: r227175 - head/usr.bin/pr

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:24 2011
New Revision: 227175
URL: http://svn.freebsd.org/changeset/base/227175

Log:
  Add missing static keywords to pr(1)

Modified:
  head/usr.bin/pr/extern.h
  head/usr.bin/pr/pr.c

Modified: head/usr.bin/pr/extern.h
==
--- head/usr.bin/pr/extern.hSun Nov  6 08:16:18 2011(r227174)
+++ head/usr.bin/pr/extern.hSun Nov  6 08:16:24 2011(r227175)
@@ -38,7 +38,9 @@
  * $FreeBSD$
  */
 
+extern int eopterr;
 extern int eoptind;
+extern int eoptopt;
 extern char *eoptarg;
 
 voidaddnum(char *, int, int);

Modified: head/usr.bin/pr/pr.c
==
--- head/usr.bin/pr/pr.cSun Nov  6 08:16:18 2011(r227174)
+++ head/usr.bin/pr/pr.cSun Nov  6 08:16:24 2011(r227175)
@@ -80,40 +80,40 @@ __FBSDID("$FreeBSD$");
 /*
  * parameter variables
  */
-intpgnm;   /* starting page number */
-intclcnt;  /* number of columns */
-intcolwd;  /* column data width - multiple columns */
-intacross; /* mult col flag; write across page */
-intdspace; /* double space flag */
-char   inchar; /* expand input char */
-intingap;  /* expand input gap */
-intpausefst;   /* Pause before first page */
-intpauseall;   /* Pause before each page */
-intformfeed;   /* use formfeed as trailer */
-char   *header;/* header name instead of file name */
-char   ochar;  /* contract output char */
-intogap;   /* contract output gap */
-intlines;  /* number of lines per page */
-intmerge;  /* merge multiple files in output */
-char   nmchar; /* line numbering append char */
-intnmwd;   /* width of line number field */
-intoffst;  /* number of page offset spaces */
-intnodiag; /* do not report file open errors */
-char   schar;  /* text column separation character */
-intsflag;  /* -s option for multiple columns */
-intnohead; /* do not write head and trailer */
-intpgwd;   /* page width with multiple col output */
-const char *timefrmt;  /* time conversion string */
+static int pgnm;   /* starting page number */
+static int clcnt;  /* number of columns */
+static int colwd;  /* column data width - multiple columns */
+static int across; /* mult col flag; write across page */
+static int dspace; /* double space flag */
+static charinchar; /* expand input char */
+static int ingap;  /* expand input gap */
+static int pausefst;   /* Pause before first page */
+static int pauseall;   /* Pause before each page */
+static int formfeed;   /* use formfeed as trailer */
+static char*header;/* header name instead of file name */
+static charochar;  /* contract output char */
+static int ogap;   /* contract output gap */
+static int lines;  /* number of lines per page */
+static int merge;  /* merge multiple files in output */
+static charnmchar; /* line numbering append char */
+static int nmwd;   /* width of line number field */
+static int offst;  /* number of page offset spaces */
+static int nodiag; /* do not report file open errors */
+static charschar;  /* text column separation character */
+static int sflag;  /* -s option for multiple columns */
+static int nohead; /* do not write head and trailer */
+static int pgwd;   /* page width with multiple col output */
+static const char *timefrmt;   /* time conversion string */
 
 /*
  * misc globals
  */
-FILE   *err;   /* error message file pointer */
-intaddone; /* page length is odd with double space */
-interrcnt; /* error count on file processing */
-char   digs[] = "0123456789";  /* page number translation map */
+static FILE*err;   /* error message file pointer */
+static int addone; /* page length is odd with double space */
+static int errcnt; /* error count on file processing */
+static chardigs[] = "0123456789"; /* page number translation map */
 
-char   fnamedefault[] = FNAME;
+static charfnamedefault[] = FNAME;
 
 int
 main(int argc, char *argv[])
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227165 - head/usr.bin/fold

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:23 2011
New Revision: 227165
URL: http://svn.freebsd.org/changeset/base/227165

Log:
  Add missing static keywords to fold(1)

Modified:
  head/usr.bin/fold/fold.c

Modified: head/usr.bin/fold/fold.c
==
--- head/usr.bin/fold/fold.cSun Nov  6 08:15:17 2011(r227164)
+++ head/usr.bin/fold/fold.cSun Nov  6 08:15:23 2011(r227165)
@@ -61,8 +61,8 @@ void fold(int);
 static int newpos(int, wint_t);
 static void usage(void);
 
-int bflag; /* Count bytes, not columns */
-int sflag; /* Split on word boundaries */
+static int bflag;  /* Count bytes, not columns */
+static int sflag;  /* Split on word boundaries */
 
 int
 main(int argc, char **argv)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227168 - head/usr.bin/last

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:41 2011
New Revision: 227168
URL: http://svn.freebsd.org/changeset/base/227168

Log:
  Add missing static keywords to last(1)

Modified:
  head/usr.bin/last/last.c

Modified: head/usr.bin/last/last.c
==
--- head/usr.bin/last/last.cSun Nov  6 08:15:35 2011(r227167)
+++ head/usr.bin/last/last.cSun Nov  6 08:15:41 2011(r227168)
@@ -70,9 +70,9 @@ typedef struct arg {
int type;   /* type of arg */
struct arg  *next;  /* linked list pointer */
 } ARG;
-ARG*arglist;   /* head of linked list */
+static ARG *arglist;   /* head of linked list */
 
-LIST_HEAD(idlisthead, idtab) idlist;
+static LIST_HEAD(idlisthead, idtab) idlist;
 
 struct idtab {
time_t  logout; /* log out time */
@@ -94,17 +94,17 @@ static time_t   snaptime;   /* if 
!= 0, we
 * at this snapshot time
 */
 
-voidaddarg(int, char *);
-time_t  dateconv(char *);
-voiddoentry(struct utmpx *);
-voidhostconv(char *);
-voidprintentry(struct utmpx *, struct idtab *);
-char   *ttyconv(char *);
-int want(struct utmpx *);
-voidusage(void);
-voidwtmp(void);
+static void addarg(int, char *);
+static time_t   dateconv(char *);
+static void doentry(struct utmpx *);
+static void hostconv(char *);
+static void printentry(struct utmpx *, struct idtab *);
+static char*ttyconv(char *);
+static int  want(struct utmpx *);
+static void usage(void);
+static void wtmp(void);
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr,
@@ -196,7 +196,7 @@ main(int argc, char *argv[])
  * wtmp --
  * read through the wtmp file
  */
-void
+static void
 wtmp(void)
 {
struct utmpx *buf = NULL;
@@ -237,7 +237,7 @@ wtmp(void)
  * doentry --
  * process a single wtmp entry
  */
-void
+static void
 doentry(struct utmpx *bp)
 {
struct idtab*tt, *ttx;  /* idlist entry */
@@ -313,7 +313,7 @@ doentry(struct utmpx *bp)
  * If `tt' is non-NULL, use it and `crmsg' to print the logout time or
  * logout type (crash/shutdown) as appropriate.
  */
-void
+static void
 printentry(struct utmpx *bp, struct idtab *tt)
 {
char ct[80];
@@ -378,7 +378,7 @@ printentry(struct utmpx *bp, struct idta
  * want --
  * see if want this entry
  */
-int
+static int
 want(struct utmpx *bp)
 {
ARG *step;
@@ -411,7 +411,7 @@ want(struct utmpx *bp)
  * addarg --
  * add an entry to a linked list of arguments
  */
-void
+static void
 addarg(int type, char *arg)
 {
ARG *cur;
@@ -430,7 +430,7 @@ addarg(int type, char *arg)
  * has a domain attached that is the same as the current domain, rip
  * off the domain suffix since that's what login(1) does.
  */
-void
+static void
 hostconv(char *arg)
 {
static int first = 1;
@@ -453,7 +453,7 @@ hostconv(char *arg)
  * ttyconv --
  * convert tty to correct name.
  */
-char *
+static char *
 ttyconv(char *arg)
 {
char *mval;
@@ -485,7 +485,7 @@ ttyconv(char *arg)
  * [[CC]YY]MMDDhhmm[.SS]] to a time_t.
  * Derived from atime_arg1() in usr.bin/touch/touch.c
  */
-time_t
+static time_t
 dateconv(char *arg)
 {
 time_t timet;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227169 - head/usr.bin/lock

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:48 2011
New Revision: 227169
URL: http://svn.freebsd.org/changeset/base/227169

Log:
  Add missing static keywords to lock(1)

Modified:
  head/usr.bin/lock/lock.c

Modified: head/usr.bin/lock/lock.c
==
--- head/usr.bin/lock/lock.cSun Nov  6 08:15:41 2011(r227168)
+++ head/usr.bin/lock/lock.cSun Nov  6 08:15:48 2011(r227169)
@@ -72,17 +72,17 @@ __FBSDID("$FreeBSD$");
 
 #defineTIMEOUT 15
 
-void quit(int);
-void bye(int);
-void hi(int);
+static void quit(int);
+static void bye(int);
+static void hi(int);
 static void usage(void);
 
-struct timeval timeout;
-struct timeval zerotime;
-struct termios tty, ntty;
-long   nexttime;   /* keep the timeout time */
-intno_timeout; /* lock terminal forever */
-intvtyunlock;  /* Unlock flag and code. */
+static struct timeval  timeout;
+static struct timeval  zerotime;
+static struct termios  tty, ntty;
+static longnexttime;   /* keep the timeout time */
+static int no_timeout; /* lock terminal forever */
+static int vtyunlock;  /* Unlock flag and code. */
 
 /*ARGSUSED*/
 int
@@ -252,7 +252,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 hi(int signo __unused)
 {
struct timeval timval;
@@ -269,7 +269,7 @@ hi(int signo __unused)
}
 }
 
-void
+static void
 quit(int signo __unused)
 {
(void)putchar('\n');
@@ -279,7 +279,7 @@ quit(int signo __unused)
exit(0);
 }
 
-void
+static void
 bye(int signo __unused)
 {
if (!no_timeout) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227170 - head/usr.bin/logger

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:53 2011
New Revision: 227170
URL: http://svn.freebsd.org/changeset/base/227170

Log:
  Add missing static keywords to logger(1)

Modified:
  head/usr.bin/logger/logger.c

Modified: head/usr.bin/logger/logger.c
==
--- head/usr.bin/logger/logger.cSun Nov  6 08:15:48 2011
(r227169)
+++ head/usr.bin/logger/logger.cSun Nov  6 08:15:53 2011
(r227170)
@@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$");
 #defineSYSLOG_NAMES
 #include 
 
-intdecode(char *, CODE *);
-intpencode(char *);
+static int decode(char *, CODE *);
+static int pencode(char *);
 static voidlogmessage(int, const char *, const char *, const char *,
   const char *);
 static voidusage(void);
@@ -70,11 +70,11 @@ struct socks {
 };
 
 #ifdef INET6
-intfamily = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
+static int family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
 #else
-intfamily = PF_INET;   /* protocol family (IPv4 only) */
+static int family = PF_INET;   /* protocol family (IPv4 only) */
 #endif
-intsend_to_all = 0;/* send message to all IPv4/IPv6 addresses */
+static int send_to_all = 0;/* send message to all IPv4/IPv6 addresses */
 
 /*
  * logger -- read and log utility
@@ -176,7 +176,7 @@ main(int argc, char *argv[])
 /*
  *  Send the message to syslog, either on the local host, or on a remote host
  */
-void
+static void
 logmessage(int pri, const char *tag, const char *host, const char *svcname,
   const char *buf)
 {
@@ -246,7 +246,7 @@ logmessage(int pri, const char *tag, con
 /*
  *  Decode a symbolic name to a numeric value
  */
-int
+static int
 pencode(char *s)
 {
char *save;
@@ -270,7 +270,7 @@ pencode(char *s)
return ((lev & LOG_PRIMASK) | (fac & LOG_FACMASK));
 }
 
-int
+static int
 decode(char *name, CODE *codetab)
 {
CODE *c;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227171 - head/usr.bin/look

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:15:59 2011
New Revision: 227171
URL: http://svn.freebsd.org/changeset/base/227171

Log:
  Add missing static keywords to look(1)

Modified:
  head/usr.bin/look/look.c

Modified: head/usr.bin/look/look.c
==
--- head/usr.bin/look/look.cSun Nov  6 08:15:53 2011(r227170)
+++ head/usr.bin/look/look.cSun Nov  6 08:15:59 2011(r227171)
@@ -77,14 +77,14 @@ static char _path_words[] = _PATH_WORDS;
 #defineGREATER 1
 #defineLESS(-1)
 
-int dflag, fflag;
+static int dflag, fflag;
 
-char*binary_search(wchar_t *, unsigned char *, unsigned char *);
-int  compare(wchar_t *, unsigned char *, unsigned char *);
-char*linear_search(wchar_t *, unsigned char *, unsigned char *);
-int  look(wchar_t *, unsigned char *, unsigned char *);
-wchar_t*prepkey(const char *, wchar_t);
-void print_from(wchar_t *, unsigned char *, unsigned char *);
+static char*binary_search(wchar_t *, unsigned char *, unsigned char *);
+static int  compare(wchar_t *, unsigned char *, unsigned char *);
+static char*linear_search(wchar_t *, unsigned char *, unsigned char *);
+static int  look(wchar_t *, unsigned char *, unsigned char *);
+static wchar_t *prepkey(const char *, wchar_t);
+static void print_from(wchar_t *, unsigned char *, unsigned char *);
 
 static void usage(void);
 
@@ -151,7 +151,7 @@ main(int argc, char *argv[])
exit(match);
 }
 
-wchar_t *
+static wchar_t *
 prepkey(const char *string, wchar_t termchar)
 {
const char *readp;
@@ -182,7 +182,7 @@ prepkey(const char *string, wchar_t term
return (key);
 }
 
-int
+static int
 look(wchar_t *string, unsigned char *front, unsigned char *back)
 {
 
@@ -236,7 +236,7 @@ look(wchar_t *string, unsigned char *fro
 #defineSKIP_PAST_NEWLINE(p, back) \
while (p < back && *p++ != '\n');
 
-char *
+static char *
 binary_search(wchar_t *string, unsigned char *front, unsigned char *back)
 {
unsigned char *p;
@@ -270,7 +270,7 @@ binary_search(wchar_t *string, unsigned 
  * o front points at the first character in a line.
  * o front is before or at the first line to be printed.
  */
-char *
+static char *
 linear_search(wchar_t *string, unsigned char *front, unsigned char *back)
 {
while (front < back) {
@@ -290,7 +290,7 @@ linear_search(wchar_t *string, unsigned 
 /*
  * Print as many lines as match string, starting at front.
  */
-void
+static void
 print_from(wchar_t *string, unsigned char *front, unsigned char *back)
 {
for (; front < back && compare(string, front, back) == EQUAL; ++front) {
@@ -315,7 +315,7 @@ print_from(wchar_t *string, unsigned cha
  * The string "s1" is null terminated.  The string s2 is '\n' terminated (or
  * "back" terminated).
  */
-int
+static int
 compare(wchar_t *s1, unsigned char *s2, unsigned char *back)
 {
wchar_t ch1, ch2;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227172 - head/usr.bin/make

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:06 2011
New Revision: 227172
URL: http://svn.freebsd.org/changeset/base/227172

Log:
  Add missing static keywords to make(1)

Modified:
  head/usr.bin/make/globals.h

Modified: head/usr.bin/make/globals.h
==
--- head/usr.bin/make/globals.h Sun Nov  6 08:15:59 2011(r227171)
+++ head/usr.bin/make/globals.h Sun Nov  6 08:16:06 2011(r227172)
@@ -75,6 +75,7 @@ extern BooleanbeSilent;   /* True if shou
 extern Boolean beVerbose;  /* True if should print extra cruft */
 extern Boolean beQuiet;/* True if want quiet headers with -j */
 extern Boolean noExecute;  /* True if should execute nothing */
+extern Boolean printGraphOnly; /* -p flag */
 extern Boolean allPrecious;/* True if every target is precious */
 extern Boolean is_posix;   /* .POSIX target seen */
 extern Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227173 - head/usr.bin/ministat

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:11 2011
New Revision: 227173
URL: http://svn.freebsd.org/changeset/base/227173

Log:
  Add missing static keywords to ministat(1)

Modified:
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.c
==
--- head/usr.bin/ministat/ministat.cSun Nov  6 08:16:06 2011
(r227172)
+++ head/usr.bin/ministat/ministat.cSun Nov  6 08:16:11 2011
(r227173)
@@ -23,8 +23,8 @@ __FBSDID("$FreeBSD$");
 
 #define NSTUDENT 100
 #define NCONF 6
-double const studentpct[] = { 80, 90, 95, 98, 99, 99.5 };
-double student [NSTUDENT + 1][NCONF] = {
+static double const studentpct[] = { 80, 90, 95, 98, 99, 99.5 };
+static double student[NSTUDENT + 1][NCONF] = {
 /* inf */  {   1.282,  1.645,  1.960,  2.326,  2.576,  3.090  },
 /* 1. */   {   3.078,  6.314,  12.706, 31.821, 63.657, 318.313  },
 /* 2. */   {   1.886,  2.920,  4.303,  6.965,  9.925,  22.327  },
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227174 - head/usr.bin/mt

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:18 2011
New Revision: 227174
URL: http://svn.freebsd.org/changeset/base/227174

Log:
  Add missing static keywords to mt(1)

Modified:
  head/usr.bin/mt/mt.c

Modified: head/usr.bin/mt/mt.c
==
--- head/usr.bin/mt/mt.cSun Nov  6 08:16:11 2011(r227173)
+++ head/usr.bin/mt/mt.cSun Nov  6 08:16:18 2011(r227174)
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
 #define FALSE 0
 #endif
 
-struct commands {
+static const struct commands {
const char *c_name;
int c_code;
int c_ronly;
@@ -114,22 +114,22 @@ struct commands {
{ NULL, 0, 0, 0 }
 };
 
-const char *getblksiz(int);
-void printreg(const char *, u_int, const char *);
-void status(struct mtget *);
-void usage(void);
-void st_status (struct mtget *);
-int stringtodens (const char *s);
-const char *denstostring (int d);
-int denstobp(int d, int bpi);
-u_int32_t stringtocomp(const char *s);
-const char *comptostring(u_int32_t comp);
-void warn_eof(void);
+static const char *getblksiz(int);
+static void printreg(const char *, u_int, const char *);
+static void status(struct mtget *);
+static void usage(void);
+static void st_status(struct mtget *);
+static int stringtodens(const char *s);
+static const char *denstostring(int d);
+static int denstobp(int d, int bpi);
+static u_int32_t stringtocomp(const char *s);
+static const char *comptostring(u_int32_t comp);
+static void warn_eof(void);
 
 int
 main(int argc, char *argv[])
 {
-   struct commands *comp;
+   const struct commands *comp;
struct mtget mt_status;
struct mtop mt_com;
int ch, len, mtfd;
@@ -303,7 +303,7 @@ main(int argc, char *argv[])
/* NOTREACHED */
 }
 
-struct tape_desc {
+static const struct tape_desc {
short   t_type; /* type of magtape device */
const char *t_name; /* printing name */
const char *t_dsbits;   /* "drive status" register */
@@ -316,10 +316,10 @@ struct tape_desc {
 /*
  * Interpret the status buffer returned
  */
-void
+static void
 status(struct mtget *bp)
 {
-   struct tape_desc *mt;
+   const struct tape_desc *mt;
 
for (mt = tapes;; mt++) {
if (mt->t_type == 0) {
@@ -344,7 +344,7 @@ status(struct mtget *bp)
 /*
  * Print a register a la the %b format of the kernel's printf.
  */
-void
+static void
 printreg(const char *s, u_int v, const char *bits)
 {
int i, any = 0;
@@ -374,14 +374,14 @@ printreg(const char *s, u_int v, const c
}
 }
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr, "usage: mt [-f device] command [count]\n");
exit(1);
 }
 
-struct densities {
+static const struct densities {
int dens;
int bpmm;
int bpi;
@@ -437,7 +437,7 @@ struct densities {
{ 0, 0, 0, NULL }
 };
 
-struct compression_types {
+static const struct compression_types {
u_int32_t   comp_number;
const char  *name;
 } comp_types[] = {
@@ -450,11 +450,11 @@ struct compression_types {
{ 0xf0f0f0f0, NULL}
 };
 
-const char *
+static const char *
 denstostring(int d)
 {
static char buf[20];
-   struct densities *sd;
+   const struct densities *sd;
 
/* densities 0 and 0x7f are handled as special cases */
if (d == 0)
@@ -475,10 +475,10 @@ denstostring(int d)
  * Given a specific density number, return either the bits per inch or bits
  * per millimeter for the given density.
  */
-int
+static int
 denstobp(int d, int bpi)
 {
-   struct densities *sd;
+   const struct densities *sd;
 
for (sd = dens; sd->dens; sd++)
if (sd->dens == d)
@@ -493,10 +493,10 @@ denstobp(int d, int bpi)
}
 }
 
-int
+static int
 stringtodens(const char *s)
 {
-   struct densities *sd;
+   const struct densities *sd;
size_t l = strlen(s);
 
for (sd = dens; sd->dens; sd++)
@@ -506,7 +506,7 @@ stringtodens(const char *s)
 }
 
 
-const char *
+static const char *
 getblksiz(int bs)
 {
static char buf[25];
@@ -518,11 +518,11 @@ getblksiz(int bs)
}
 }
 
-const char *
+static const char *
 comptostring(u_int32_t comp)
 {
static char buf[20];
-   struct compression_types *ct;
+   const struct compression_types *ct;
 
if (comp == MT_COMP_DISABLED)
return "disabled";
@@ -540,10 +540,10 @@ comptostring(u_int32_t comp)
return(ct->name);
 }
 
-u_int32_t
+static u_int32_t
 stringtocomp(const char *s)
 {
-   struct compression_types *ct;
+   const struct compression_types *ct;
size_t l = strlen(s);
 
for (ct = comp_types; ct->name; ct++)
@@ -553,7 +553,7 @@ stringtocomp(const char *s)
return(ct->comp_number);
 }
 
-void
+static void
 st_status(struct mtget *bp)
 {
printf("Mode  Density  Blocksize  bpi  "
@@ -634,7 +634,7 @@ st_status(struct 

svn commit: r227185 - head/usr.bin/talk

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:23 2011
New Revision: 227185
URL: http://svn.freebsd.org/changeset/base/227185

Log:
  Add missing static keywords to talk(1)

Modified:
  head/usr.bin/talk/ctl.c
  head/usr.bin/talk/init_disp.c
  head/usr.bin/talk/invite.c
  head/usr.bin/talk/talk.h

Modified: head/usr.bin/talk/ctl.c
==
--- head/usr.bin/talk/ctl.c Sun Nov  6 08:17:17 2011(r227184)
+++ head/usr.bin/talk/ctl.c Sun Nov  6 08:17:23 2011(r227185)
@@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)ctl.c   
 #include 
 
 #include "talk.h"
+#include "talk_ctl.h"
 
 struct sockaddr_in daemon_addr = { .sin_len = sizeof(daemon_addr), .sin_family 
= AF_INET };
 struct sockaddr_in ctl_addr = { .sin_len = sizeof(ctl_addr), .sin_family = 
AF_INET };

Modified: head/usr.bin/talk/init_disp.c
==
--- head/usr.bin/talk/init_disp.c   Sun Nov  6 08:17:17 2011
(r227184)
+++ head/usr.bin/talk/init_disp.c   Sun Nov  6 08:17:23 2011
(r227185)
@@ -50,8 +50,6 @@ static const char sccsid[] = "@(#)init_d
 
 #include "talk.h"
 
-extern volatile sig_atomic_t gotwinch;
-
 /*
  * Make sure the callee can write to the screen
  */

Modified: head/usr.bin/talk/invite.c
==
--- head/usr.bin/talk/invite.c  Sun Nov  6 08:17:17 2011(r227184)
+++ head/usr.bin/talk/invite.c  Sun Nov  6 08:17:23 2011(r227185)
@@ -60,8 +60,8 @@ static const char sccsid[] = "@(#)invite
  * These are used to delete the
  * invitations.
  */
-intlocal_id, remote_id;
-jmp_buf invitebuf;
+static int local_id, remote_id;
+static jmp_buf invitebuf;
 
 void
 invite_remote(void)

Modified: head/usr.bin/talk/talk.h
==
--- head/usr.bin/talk/talk.hSun Nov  6 08:17:17 2011(r227184)
+++ head/usr.bin/talk/talk.hSun Nov  6 08:17:23 2011(r227185)
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 extern int sockt;
 extern int curses_initialized;
@@ -46,6 +47,8 @@ externint invitation_waiting;
 extern const char *current_state;
 extern int current_line;
 
+extern volatile sig_atomic_t gotwinch;
+
 typedef struct xwin {
WINDOW  *x_win;
int x_nlines;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227184 - head/usr.bin/tail

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:17 2011
New Revision: 227184
URL: http://svn.freebsd.org/changeset/base/227184

Log:
  Add missing static keywords to tail(1)

Modified:
  head/usr.bin/tail/forward.c
  head/usr.bin/tail/tail.c

Modified: head/usr.bin/tail/forward.c
==
--- head/usr.bin/tail/forward.c Sun Nov  6 08:17:11 2011(r227183)
+++ head/usr.bin/tail/forward.c Sun Nov  6 08:17:17 2011(r227184)
@@ -66,9 +66,9 @@ static void set_events(file_info_t *file
 #define USE_KQUEUE 1
 #define ADD_EVENTS 2
 
-struct kevent *ev;
-int action = USE_SLEEP;
-int kq;
+static struct kevent *ev;
+static int action = USE_SLEEP;
+static int kq;
 
 static const file_info_t *last;
 

Modified: head/usr.bin/tail/tail.c
==
--- head/usr.bin/tail/tail.cSun Nov  6 08:17:11 2011(r227183)
+++ head/usr.bin/tail/tail.cSun Nov  6 08:17:17 2011(r227184)
@@ -58,7 +58,7 @@ static const char sccsid[] = "@(#)tail.c
 
 int Fflag, fflag, qflag, rflag, rval, no_files;
 
-file_info_t *files;
+static file_info_t *files;
 
 static void obsolete(char **);
 static void usage(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227187 - head/usr.bin/tee

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:35 2011
New Revision: 227187
URL: http://svn.freebsd.org/changeset/base/227187

Log:
  Add missing static keywords to tee(1)

Modified:
  head/usr.bin/tee/tee.c

Modified: head/usr.bin/tee/tee.c
==
--- head/usr.bin/tee/tee.c  Sun Nov  6 08:17:29 2011(r227186)
+++ head/usr.bin/tee/tee.c  Sun Nov  6 08:17:35 2011(r227187)
@@ -56,9 +56,9 @@ typedef struct _list {
int fd;
const char *name;
 } LIST;
-LIST *head;
+static LIST *head;
 
-void add(int, const char *);
+static void add(int, const char *);
 static void usage(void);
 
 int
@@ -125,7 +125,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 add(int fd, const char *name)
 {
LIST *p;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227189 - head/usr.bin/tsort

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:47 2011
New Revision: 227189
URL: http://svn.freebsd.org/changeset/base/227189

Log:
  Add missing static keywords to tsort(1)

Modified:
  head/usr.bin/tsort/tsort.c

Modified: head/usr.bin/tsort/tsort.c
==
--- head/usr.bin/tsort/tsort.c  Sun Nov  6 08:17:42 2011(r227188)
+++ head/usr.bin/tsort/tsort.c  Sun Nov  6 08:17:47 2011(r227189)
@@ -96,18 +96,18 @@ typedef struct _buf {
int b_bsize;
 } BUF;
 
-DB *db;
-NODE *graph, **cycle_buf, **longest_cycle;
-int debug, longest, quiet;
-
-voidadd_arc(char *, char *);
-int find_cycle(NODE *, NODE *, int, int);
-NODE   *get_node(char *);
-void   *grow_buf(void *, size_t);
-voidremove_node(NODE *);
-voidclear_cycle(void);
-voidtsort(void);
-voidusage(void);
+static DB *db;
+static NODE *graph, **cycle_buf, **longest_cycle;
+static int debug, longest, quiet;
+
+static void add_arc(char *, char *);
+static int  find_cycle(NODE *, NODE *, int, int);
+static NODE*get_node(char *);
+static void*grow_buf(void *, size_t);
+static void remove_node(NODE *);
+static void clear_cycle(void);
+static void tsort(void);
+static void usage(void);
 
 int
 main(int argc, char *argv[])
@@ -185,7 +185,7 @@ main(int argc, char *argv[])
 }
 
 /* double the size of oldbuf and return a pointer to the new buffer. */
-void *
+static void *
 grow_buf(void *bp, size_t size)
 {
if ((bp = realloc(bp, size)) == NULL)
@@ -197,7 +197,7 @@ grow_buf(void *bp, size_t size)
  * add an arc from node s1 to node s2 in the graph.  If s1 or s2 are not in
  * the graph, then add them.
  */
-void
+static void
 add_arc(char *s1, char *s2)
 {
NODE *n1;
@@ -232,7 +232,7 @@ add_arc(char *s1, char *s2)
 }
 
 /* Find a node in the graph (insert if not found) and return a pointer to it. 
*/
-NODE *
+static NODE *
 get_node(char *name)
 {
DBT data, key;
@@ -284,7 +284,7 @@ get_node(char *name)
 /*
  * Clear the NODEST flag from all nodes.
  */
-void
+static void
 clear_cycle(void)
 {
NODE *n;
@@ -294,7 +294,7 @@ clear_cycle(void)
 }
 
 /* do topological sort on graph */
-void
+static void
 tsort(void)
 {
NODE *n, *next;
@@ -357,7 +357,7 @@ tsort(void)
 }
 
 /* print node and remove from graph (does not actually free node) */
-void
+static void
 remove_node(NODE *n)
 {
NODE **np;
@@ -374,7 +374,7 @@ remove_node(NODE *n)
 
 
 /* look for the longest? cycle from node from to node to. */
-int
+static int
 find_cycle(NODE *from, NODE *to, int longest_len, int depth)
 {
NODE **np;
@@ -420,7 +420,7 @@ find_cycle(NODE *from, NODE *to, int lon
return (longest_len);
 }
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr, "usage: tsort [-dlq] [file]\n");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227190 - head/usr.bin/ul

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:53 2011
New Revision: 227190
URL: http://svn.freebsd.org/changeset/base/227190

Log:
  Add missing static keywords to ul(1)

Modified:
  head/usr.bin/ul/ul.c

Modified: head/usr.bin/ul/ul.c
==
--- head/usr.bin/ul/ul.cSun Nov  6 08:17:47 2011(r227189)
+++ head/usr.bin/ul/ul.cSun Nov  6 08:17:53 2011(r227190)
@@ -66,8 +66,8 @@ static const char rcsid[] =
 #defineUNDERL  010 /* Ul */
 #defineBOLD020 /* Bold */
 
-intmust_use_uc, must_overstrike;
-const char
+static int must_use_uc, must_overstrike;
+static const char
*CURS_UP, *CURS_RIGHT, *CURS_LEFT,
*ENTER_STANDOUT, *EXIT_STANDOUT, *ENTER_UNDERLINE, *EXIT_UNDERLINE,
*ENTER_DIM, *ENTER_BOLD, *ENTER_REVERSE, *UNDER_CHAR, *EXIT_ATTRIBUTES;
@@ -78,25 +78,25 @@ struct  CHAR{
int c_width;/* width or -1 if multi-column char. filler */
 } ;
 
-struct CHARobuf[MAXBUF];
-intcol, maxcol;
-intmode;
-inthalfpos;
-intupln;
-intiflag;
+static struct  CHARobuf[MAXBUF];
+static int col, maxcol;
+static int mode;
+static int halfpos;
+static int upln;
+static int iflag;
 
 static void usage(void);
-void setnewmode(int);
-void initcap(void);
-void reverse(void);
-int outchar(int);
-void fwd(void);
-void initbuf(void);
-void iattr(void);
-void overstrike(void);
-void flushln(void);
-void filter(FILE *);
-void outc(wint_t, int);
+static void setnewmode(int);
+static void initcap(void);
+static void reverse(void);
+static int outchar(int);
+static void fwd(void);
+static void initbuf(void);
+static void iattr(void);
+static void overstrike(void);
+static void flushln(void);
+static void filter(FILE *);
+static void outc(wint_t, int);
 
 #definePRINT(s)if (s == NULL) /* void */; else tputs(s, 1, 
outchar)
 
@@ -165,7 +165,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 filter(FILE *f)
 {
wint_t c;
@@ -299,7 +299,7 @@ filter(FILE *f)
flushln();
 }
 
-void
+static void
 flushln(void)
 {
int lastmode;
@@ -341,7 +341,7 @@ flushln(void)
  * For terminals that can overstrike, overstrike underlines and bolds.
  * We don't do anything with halfline ups and downs, or Greek.
  */
-void
+static void
 overstrike(void)
 {
int i;
@@ -381,7 +381,7 @@ overstrike(void)
}
 }
 
-void
+static void
 iattr(void)
 {
int i;
@@ -405,7 +405,7 @@ iattr(void)
putwchar('\n');
 }
 
-void
+static void
 initbuf(void)
 {
 
@@ -415,7 +415,7 @@ initbuf(void)
mode &= ALTSET;
 }
 
-void
+static void
 fwd(void)
 {
int oldcol, oldmax;
@@ -427,7 +427,7 @@ fwd(void)
maxcol = oldmax;
 }
 
-void
+static void
 reverse(void)
 {
upln++;
@@ -437,7 +437,7 @@ reverse(void)
upln++;
 }
 
-void
+static void
 initcap(void)
 {
static char tcapbuf[512];
@@ -490,7 +490,7 @@ initcap(void)
must_use_uc = (UNDER_CHAR && !ENTER_UNDERLINE);
 }
 
-int
+static int
 outchar(int c)
 {
return (putwchar(c) != WEOF ? c : EOF);
@@ -498,7 +498,7 @@ outchar(int c)
 
 static int curmode = 0;
 
-void
+static void
 outc(wint_t c, int width)
 {
int i;
@@ -512,7 +512,7 @@ outc(wint_t c, int width)
}
 }
 
-void
+static void
 setnewmode(int newmode)
 {
if (!iflag) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227202 - head/usr.bin/xinstall

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:19:07 2011
New Revision: 227202
URL: http://svn.freebsd.org/changeset/base/227202

Log:
  Add missing static keywords to xinstall(1)

Modified:
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cSun Nov  6 08:19:00 2011
(r227201)
+++ head/usr.bin/xinstall/xinstall.cSun Nov  6 08:19:07 2011
(r227202)
@@ -73,13 +73,14 @@ __FBSDID("$FreeBSD$");
 #defineNOCHANGEBITS(UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | 
SF_APPEND)
 #defineBACKUP_SUFFIX   ".old"
 
-struct passwd *pp;
-struct group *gp;
-gid_t gid;
-uid_t uid;
-int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, verbose;
-mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
-const char *suffix = BACKUP_SUFFIX;
+static struct passwd *pp;
+static struct group *gp;
+static gid_t gid;
+static uid_t uid;
+static int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy,
+verbose;
+static mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
+static const char *suffix = BACKUP_SUFFIX;
 
 static int compare(int, const char *, size_t, int, const char *, size_t);
 static voidcopy(int, const char *, int, const char *, off_t);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227176 - head/usr.bin/quota

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:29 2011
New Revision: 227176
URL: http://svn.freebsd.org/changeset/base/227176

Log:
  Add missing static keywords to quota(1)

Modified:
  head/usr.bin/quota/quota.c

Modified: head/usr.bin/quota/quota.c
==
--- head/usr.bin/quota/quota.c  Sun Nov  6 08:16:24 2011(r227175)
+++ head/usr.bin/quota/quota.c  Sun Nov  6 08:16:29 2011(r227176)
@@ -73,8 +73,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-const char *qfname = QUOTAFILENAME;
-const char *qfextension[] = INITQFNAMES;
+static const char *qfextension[] = INITQFNAMES;
 
 struct quotause {
struct  quotause *next;
@@ -101,12 +100,12 @@ static int callaurpc(char *host, int pro
xdrproc_t inproc, char *in, xdrproc_t outproc, char *out);
 static int alldigits(char *s);
 
-inthflag;
-intlflag;
-intrflag;
-intqflag;
-intvflag;
-char   *filename = NULL;
+static int hflag;
+static int lflag;
+static int rflag;
+static int qflag;
+static int vflag;
+static char*filename = NULL;
 
 int
 main(int argc, char *argv[])
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227177 - head/usr.bin/rs

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:35 2011
New Revision: 227177
URL: http://svn.freebsd.org/changeset/base/227177

Log:
  Add missing static keywords to rs(1)

Modified:
  head/usr.bin/rs/rs.c

Modified: head/usr.bin/rs/rs.c
==
--- head/usr.bin/rs/rs.cSun Nov  6 08:16:29 2011(r227176)
+++ head/usr.bin/rs/rs.cSun Nov  6 08:16:35 2011(r227177)
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-long   flags;
+static longflags;
 #defineTRANSPOSE   01
 #defineMTRANSPOSE  02
 #defineONEPERLINE  04
@@ -72,34 +72,34 @@ longflags;
 #define ONEPERCHAR 010
 #define NOARGS 020
 
-short  *colwidths;
-short  *cord;
-short  *icbd;
-short  *ocbd;
-intnelem;
-char   **elem;
-char   **endelem;
-char   *curline;
-intallocsize = BUFSIZ;
-intcurlen;
-intirows, icols;
-intorows = 0, ocols = 0;
-intmaxlen;
-intskip;
-intpropgutter;
-char   isep = ' ', osep = ' ';
-char   blank[] = "";
-intowidth = 80, gutter = 2;
-
-void getargs(int, char *[]);
-void getfile(void);
-int  getline(void);
-char*getlist(short **, char *);
-char*getnum(int *, char *, int);
-char   **getptrs(char **);
-void prepfile(void);
-void prints(char *, int);
-void putfile(void);
+static short   *colwidths;
+static short   *cord;
+static short   *icbd;
+static short   *ocbd;
+static int nelem;
+static char**elem;
+static char**endelem;
+static char*curline;
+static int allocsize = BUFSIZ;
+static int curlen;
+static int irows, icols;
+static int orows = 0, ocols = 0;
+static int maxlen;
+static int skip;
+static int propgutter;
+static charisep = ' ', osep = ' ';
+static charblank[] = "";
+static int owidth = 80, gutter = 2;
+
+static void  getargs(int, char *[]);
+static void  getfile(void);
+static int   getline(void);
+static char *getlist(short **, char *);
+static char *getnum(int *, char *, int);
+static char**getptrs(char **);
+static void  prepfile(void);
+static void  prints(char *, int);
+static void  putfile(void);
 static void usage(void);
 
 #defineINCR(ep) do {   \
@@ -121,7 +121,7 @@ main(int argc, char *argv[])
exit(0);
 }
 
-void
+static void
 getfile(void)
 {
char *p;
@@ -189,7 +189,7 @@ getfile(void)
nelem = ep - elem;
 }
 
-void
+static void
 putfile(void)
 {
char **ep;
@@ -211,7 +211,7 @@ putfile(void)
}
 }
 
-void
+static void
 prints(char *s, int col)
 {
int n;
@@ -237,7 +237,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 prepfile(void)
 {
char **ep;
@@ -330,9 +330,9 @@ prepfile(void)
 }
 
 #defineBSIZE   (LINE_MAX * 2)
-char   ibuf[BSIZE];
+static charibuf[BSIZE];
 
-int
+static int
 getline(void)  /* get line; maintain curline, curlen; manage storage */
 {
static  int putlength;
@@ -372,7 +372,7 @@ getline(void)   /* get line; maintain curl
return(c);
 }
 
-char **
+static char **
 getptrs(char **sp)
 {
char **p;
@@ -387,7 +387,7 @@ getptrs(char **sp)
return(sp);
 }
 
-void
+static void
 getargs(int ac, char *av[])
 {
char *p;
@@ -498,7 +498,7 @@ getargs(int ac, char *av[])
}
 }
 
-char *
+static char *
 getlist(short **list, char *p)
 {
int count = 1;
@@ -534,7 +534,7 @@ getlist(short **list, char *p)
  * num = number p points to; if (strict) complain
  * returns pointer to end of num
  */
-char *
+static char *
 getnum(int *num, char *p, int strict)
 {
char *t = p;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227178 - head/usr.bin/ruptime

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:41 2011
New Revision: 227178
URL: http://svn.freebsd.org/changeset/base/227178

Log:
  Add missing static keywords to ruptime(1)

Modified:
  head/usr.bin/ruptime/ruptime.c

Modified: head/usr.bin/ruptime/ruptime.c
==
--- head/usr.bin/ruptime/ruptime.c  Sun Nov  6 08:16:35 2011
(r227177)
+++ head/usr.bin/ruptime/ruptime.c  Sun Nov  6 08:16:41 2011
(r227178)
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-struct hs {
+static struct hs {
struct  whod hs_wd;
int hs_nusers;
 } *hs;
@@ -62,19 +62,18 @@ struct hs {
 #defineISDOWN(h)   (now - (h)->hs_wd.wd_recvtime > 11 * 60)
 #defineWHDRSIZE__offsetof(struct whod, wd_we)
 
-size_t nhosts;
-time_t now;
-int rflg = 1;
-DIR *dirp;
-
-int hscmp(const void *, const void *);
-char   *interval(time_t, const char *);
-int lcmp(const void *, const void *);
-voidmorehosts(void);
-voidruptime(const char *, int, int (*)(const void *, const void *));
-int tcmp(const void *, const void *);
-int ucmp(const void *, const void *);
-voidusage(void);
+static size_t nhosts;
+static time_t now;
+static int rflg = 1;
+static DIR *dirp;
+
+static int  hscmp(const void *, const void *);
+static char*interval(time_t, const char *);
+static int  lcmp(const void *, const void *);
+static void ruptime(const char *, int, int (*)(const void *, const void 
*));
+static int  tcmp(const void *, const void *);
+static int  ucmp(const void *, const void *);
+static void usage(void);
 
 int
 main(int argc, char *argv[])
@@ -119,7 +118,7 @@ main(int argc, char *argv[])
exit(0);
 }
 
-char *
+static char *
 interval(time_t tval, const char *updown)
 {
static char resbuf[32];
@@ -147,7 +146,7 @@ interval(time_t tval, const char *updown
 #defineHS(a)   ((const struct hs *)(a))
 
 /* Alphabetical comparison. */
-int
+static int
 hscmp(const void *a1, const void *a2)
 {
return (rflg *
@@ -155,7 +154,7 @@ hscmp(const void *a1, const void *a2)
 }
 
 /* Load average comparison. */
-int
+static int
 lcmp(const void *a1, const void *a2)
 {
if (ISDOWN(HS(a1)))
@@ -170,7 +169,7 @@ lcmp(const void *a1, const void *a2)
   (HS(a2)->hs_wd.wd_loadav[0] - HS(a1)->hs_wd.wd_loadav[0]));
 }
 
-void
+static void
 ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *))
 {
struct hs *hsp;
@@ -261,7 +260,7 @@ ruptime(const char *host, int aflg, int 
 }
 
 /* Number of users comparison. */
-int
+static int
 ucmp(const void *a1, const void *a2)
 {
if (ISDOWN(HS(a1)))
@@ -276,7 +275,7 @@ ucmp(const void *a1, const void *a2)
 }
 
 /* Uptime comparison. */
-int
+static int
 tcmp(const void *a1, const void *a2)
 {
return (rflg * (
@@ -288,7 +287,7 @@ tcmp(const void *a1, const void *a2)
));
 }
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr, "usage: ruptime [-alrtu] [host ...]\n");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227179 - head/usr.bin/rusers

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:47 2011
New Revision: 227179
URL: http://svn.freebsd.org/changeset/base/227179

Log:
  Add missing static keywords to rusers(1)

Modified:
  head/usr.bin/rusers/rusers.c

Modified: head/usr.bin/rusers/rusers.c
==
--- head/usr.bin/rusers/rusers.cSun Nov  6 08:16:41 2011
(r227178)
+++ head/usr.bin/rusers/rusers.cSun Nov  6 08:16:47 2011
(r227179)
@@ -56,10 +56,10 @@ __FBSDID("$FreeBSD$");
 #define HOST_WIDTH 20
 #define LINE_WIDTH 15
 
-int longopt;
-int allopt;
+static int longopt;
+static int allopt;
 
-struct host_list {
+static struct host_list {
struct  host_list *next;
struct  in_addr addr;
 } *hosts;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227180 - head/usr.bin/rwall

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:53 2011
New Revision: 227180
URL: http://svn.freebsd.org/changeset/base/227180

Log:
  Add missing static keywords to rwall(1)

Modified:
  head/usr.bin/rwall/rwall.c

Modified: head/usr.bin/rwall/rwall.c
==
--- head/usr.bin/rwall/rwall.c  Sun Nov  6 08:16:47 2011(r227179)
+++ head/usr.bin/rwall/rwall.c  Sun Nov  6 08:16:53 2011(r227180)
@@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-char *mbuf;
+static char *mbuf;
 
 static char notty[] = "no tty";
 
-void   makemsg(const char *);
+static voidmakemsg(const char *);
 static void usage(void);
 
 /* ARGSUSED */
@@ -121,7 +121,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 makemsg(const char *fname)
 {
struct tm *lt;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227181 - head/usr.bin/rwho

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:16:59 2011
New Revision: 227181
URL: http://svn.freebsd.org/changeset/base/227181

Log:
  Add missing static keywords to rwho(1)

Modified:
  head/usr.bin/rwho/rwho.c

Modified: head/usr.bin/rwho/rwho.c
==
--- head/usr.bin/rwho/rwho.cSun Nov  6 08:16:53 2011(r227180)
+++ head/usr.bin/rwho/rwho.cSun Nov  6 08:16:59 2011(r227181)
@@ -58,16 +58,16 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-DIR*dirp;
+static DIR *dirp;
 
-struct whod wd;
+static struct  whod wd;
 #defineNUSERS  1000
-struct myutmp {
+static struct  myutmp {
charmyhost[sizeof(wd.wd_hostname)];
int myidle;
struct  outmp myutmp;
 } myutmp[NUSERS];
-intnusers;
+static int nusers;
 
 #defineWHDRSIZE(ssize_t)(sizeof (wd) - sizeof (wd.wd_we))
 /*
@@ -75,11 +75,11 @@ int nusers;
  */
 #definedown(w,now) ((now) - (w)->wd_recvtime > 11 * 60)
 
-time_t now;
-intaflg;
+static time_t  now;
+static int aflg;
 
 static void usage(void);
-int utmpcmp(const void *, const void *);
+static int utmpcmp(const void *, const void *);
 
 int
 main(int argc, char *argv[])
@@ -202,7 +202,7 @@ usage(void)
 
 #define MYUTMP(a) ((const struct myutmp *)(a))
 
-int
+static int
 utmpcmp(const void *u1, const void *u2)
 {
int rc;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227182 - head/usr.bin/seq

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:05 2011
New Revision: 227182
URL: http://svn.freebsd.org/changeset/base/227182

Log:
  Add missing static keywords to seq(1)

Modified:
  head/usr.bin/seq/seq.c

Modified: head/usr.bin/seq/seq.c
==
--- head/usr.bin/seq/seq.c  Sun Nov  6 08:16:59 2011(r227181)
+++ head/usr.bin/seq/seq.c  Sun Nov  6 08:17:05 2011(r227182)
@@ -51,20 +51,19 @@ __FBSDID("$FreeBSD$");
 
 /* Globals */
 
-const char *decimal_point = ".";   /* default */
-char default_format[] = { "%g" };  /* default */
+static const char *decimal_point = ".";/* default */
+static char default_format[] = { "%g" };   /* default */
 
 /* Prototypes */
 
-double e_atof(const char *);
+static double e_atof(const char *);
 
-int decimal_places(const char *);
-int main(int, char *[]);
-int numeric(const char *);
-int valid_format(const char *);
+static int decimal_places(const char *);
+static int numeric(const char *);
+static int valid_format(const char *);
 
-char *generate_format(double, double, double, int, char);
-char *unescape(char *);
+static char *generate_format(double, double, double, int, char);
+static char *unescape(char *);
 
 /*
  * The seq command will print out a numeric sequence from 1, the default,
@@ -186,7 +185,7 @@ main(int argc, char *argv[])
 /*
  * numeric - verify that string is numeric
  */
-int
+static int
 numeric(const char *s)
 {
int seen_decimal_pt, decimal_pt_len;
@@ -223,7 +222,7 @@ numeric(const char *s)
 /*
  * valid_format - validate user specified format string
  */
-int
+static int
 valid_format(const char *fmt)
 {
int conversions = 0;
@@ -268,7 +267,7 @@ valid_format(const char *fmt)
 /*
  * unescape - handle C escapes in a string
  */
-char *
+static char *
 unescape(char *orig)
 {
char c, *cp, *new = orig;
@@ -358,7 +357,7 @@ unescape(char *orig)
  * exit if string is not a valid double, or if converted value would
  * cause overflow or underflow
  */
-double
+static double
 e_atof(const char *num)
 {
char *endp;
@@ -383,7 +382,7 @@ e_atof(const char *num)
 /*
  * decimal_places - count decimal places in a number (string)
  */
-int
+static int
 decimal_places(const char *number)
 {
int places = 0;
@@ -405,7 +404,7 @@ decimal_places(const char *number)
  * XXX to be bug for bug compatible with Plan9 and GNU return "%g"
  * when "%g" prints as "%e" (this way no width adjustments are made)
  */
-char *
+static char *
 generate_format(double first, double incr, double last, int equalize, char pad)
 {
static char buf[256];
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227183 - head/usr.bin/split

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:11 2011
New Revision: 227183
URL: http://svn.freebsd.org/changeset/base/227183

Log:
  Add missing static keywords to split(1)

Modified:
  head/usr.bin/split/split.c

Modified: head/usr.bin/split/split.c
==
--- head/usr.bin/split/split.c  Sun Nov  6 08:17:05 2011(r227182)
+++ head/usr.bin/split/split.c  Sun Nov  6 08:17:11 2011(r227183)
@@ -61,16 +61,16 @@ static const char sccsid[] = "@(#)split.
 
 #define DEFLINE1000/* Default num lines per file. 
*/
 
-off_t   bytecnt;   /* Byte count to split on. */
-off_t   chunks = 0;/* Chunks count to split into. */
-longnumlines;  /* Line count to split on. */
-int file_open; /* If a file open. */
-int ifd = -1, ofd = -1;/* Input/output file descriptors. */
-charbfr[MAXBSIZE]; /* I/O buffer. */
-charfname[MAXPATHLEN]; /* File name prefix. */
-regex_t rgx;
-int pflag;
-longsufflen = 2;   /* File name suffix length. */
+static off_tbytecnt;   /* Byte count to split on. */
+static off_tchunks = 0;/* Chunks count to split into. */
+static long numlines;  /* Line count to split on. */
+static int  file_open; /* If a file open. */
+static int  ifd = -1, ofd = -1;/* Input/output file descriptors. */
+static char bfr[MAXBSIZE]; /* I/O buffer. */
+static char fname[MAXPATHLEN]; /* File name prefix. */
+static regex_t  rgx;
+static int  pflag;
+static long sufflen = 2;   /* File name suffix length. */
 
 static void newfile(void);
 static void split1(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227186 - head/usr.bin/tcopy

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:29 2011
New Revision: 227186
URL: http://svn.freebsd.org/changeset/base/227186

Log:
  Add missing static keywords to tcopy(1)

Modified:
  head/usr.bin/tcopy/tcopy.c

Modified: head/usr.bin/tcopy/tcopy.c
==
--- head/usr.bin/tcopy/tcopy.c  Sun Nov  6 08:17:23 2011(r227185)
+++ head/usr.bin/tcopy/tcopy.c  Sun Nov  6 08:17:29 2011(r227186)
@@ -60,16 +60,16 @@ static const char sccsid[] = "@(#)tcopy.
 #defineMAXREC  (64 * 1024)
 #defineNOCOUNT (-2)
 
-intfilen, guesslen, maxblk = MAXREC;
-u_int64_t  lastrec, record, size, tsize;
-FILE   *msg;
+static int filen, guesslen, maxblk = MAXREC;
+static uint64_tlastrec, record, size, tsize;
+static FILE*msg;
 
-void   *getspace(int);
-voidintr(int);
+static void*getspace(int);
+static void intr(int);
 static void usage(void) __dead2;
-voidverify(int, int, char *);
-voidwriteop(int, int);
-void   rewind_tape(int);
+static void verify(int, int, char *);
+static void writeop(int, int);
+static void rewind_tape(int);
 
 int
 main(int argc, char *argv[])
@@ -223,7 +223,7 @@ r1: guesslen = 0;
exit(0);
 }
 
-void
+static void
 verify(int inp, int outp, char *outb)
 {
int eot, inmaxblk, inn, outmaxblk, outn;
@@ -275,7 +275,7 @@ r2: if (inn != outn) {
exit(1);
 }
 
-void
+static void
 intr(int signo __unused)
 {
if (record) {
@@ -289,7 +289,7 @@ intr(int signo __unused)
exit(1);
 }
 
-void *
+static void *
 getspace(int blk)
 {
void *bp;
@@ -299,7 +299,7 @@ getspace(int blk)
return (bp);
 }
 
-void
+static void
 writeop(int fd, int type)
 {
struct mtop op;
@@ -317,7 +317,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 rewind_tape(int fd)
 {
struct stat sp;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227188 - head/usr.bin/tr

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:42 2011
New Revision: 227188
URL: http://svn.freebsd.org/changeset/base/227188

Log:
  Add missing static keywords to tr(1)

Modified:
  head/usr.bin/tr/tr.c

Modified: head/usr.bin/tr/tr.c
==
--- head/usr.bin/tr/tr.cSun Nov  6 08:17:35 2011(r227187)
+++ head/usr.bin/tr/tr.cSun Nov  6 08:17:42 2011(r227188)
@@ -58,8 +58,8 @@ static const char sccsid[] = "@(#)tr.c8
 #include "cset.h"
 #include "extern.h"
 
-STR s1 = { STRING1, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL };
-STR s2 = { STRING2, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL };
+static STR s1 = { STRING1, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL };
+static STR s2 = { STRING2, NORMAL, 0, OOBCH, 0, { 0, OOBCH }, NULL, NULL };
 
 static struct cset *setup(char *, STR *, int, int);
 static void usage(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227191 - head/usr.bin/uname

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:17:59 2011
New Revision: 227191
URL: http://svn.freebsd.org/changeset/base/227191

Log:
  Add missing static keywords to uname(1)

Modified:
  head/usr.bin/uname/uname.c

Modified: head/usr.bin/uname/uname.c
==
--- head/usr.bin/uname/uname.c  Sun Nov  6 08:17:53 2011(r227190)
+++ head/usr.bin/uname/uname.c  Sun Nov  6 08:17:59 2011(r227191)
@@ -63,21 +63,22 @@ static const char sccsid[] = "@(#)uname.
 #defineIFLAG   0x40
 
 typedef void (*get_t)(void);
-get_t get_ident, get_platform, get_hostname, get_arch, get_release, 
get_sysname, get_version;
+static get_t get_ident, get_platform, get_hostname, get_arch,
+get_release, get_sysname, get_version;
 
-void native_ident(void);
-void native_platform(void);
-void native_hostname(void);
-void native_arch(void);
-void native_release(void);
-void native_sysname(void);
-void native_version(void);
-void print_uname(u_int);
-void setup_get(void);
-void usage(void);
+static void native_ident(void);
+static void native_platform(void);
+static void native_hostname(void);
+static void native_arch(void);
+static void native_release(void);
+static void native_sysname(void);
+static void native_version(void);
+static void print_uname(u_int);
+static void setup_get(void);
+static void usage(void);
 
-char *ident, *platform, *hostname, *arch, *release, *sysname, *version;
-int space;
+static char *ident, *platform, *hostname, *arch, *release, *sysname, *version;
+static int space;
 
 int
 main(int argc, char *argv[])
@@ -142,7 +143,7 @@ do {
\
}   \
 } while (0)
 
-void
+static void
 setup_get(void)
 {
CHECK_ENV("s", sysname);
@@ -165,7 +166,7 @@ setup_get(void)
printf("%s", var);  \
}
 
-void
+static void
 print_uname(u_int flags)
 {
PRINT_FLAG(flags, SFLAG, sysname);
@@ -179,7 +180,7 @@ print_uname(u_int flags)
 }
 
 #defineNATIVE_SYSCTL2_GET(var,mib0,mib1)   \
-void   \
+static void\
 native_##var(void) \
 {  \
int mib[] = { (mib0), (mib1) }; \
@@ -193,7 +194,7 @@ native_##var(void)  \
err(1, "sysctl");
 
 #defineNATIVE_SYSCTLNAME_GET(var,name) \
-void   \
+static void\
 native_##var(void) \
 {  \
size_t len; \
@@ -242,7 +243,7 @@ NATIVE_SYSCTL2_GET(arch, CTL_HW, HW_MACH
 NATIVE_SYSCTLNAME_GET(ident, "kern.ident") {
 } NATIVE_SET;
 
-void
+static void
 usage(void)
 {
fprintf(stderr, "usage: uname [-aimnoprsv]\n");
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227193 - head/usr.bin/uniq

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:11 2011
New Revision: 227193
URL: http://svn.freebsd.org/changeset/base/227193

Log:
  Add missing static keywords to uniq(1)

Modified:
  head/usr.bin/uniq/uniq.c

Modified: head/usr.bin/uniq/uniq.c
==
--- head/usr.bin/uniq/uniq.cSun Nov  6 08:18:05 2011(r227192)
+++ head/usr.bin/uniq/uniq.cSun Nov  6 08:18:11 2011(r227193)
@@ -57,15 +57,15 @@ static const char rcsid[] =
 #include 
 #include 
 
-int cflag, dflag, uflag, iflag;
-int numchars, numfields, repeats;
+static int cflag, dflag, uflag, iflag;
+static int numchars, numfields, repeats;
 
-FILE   *file(const char *, const char *);
-wchar_t*convert(const char *);
-int inlcmp(const char *, const char *);
-voidshow(FILE *, const char *);
-wchar_t*skip(wchar_t *);
-voidobsolete(char *[]);
+static FILE*file(const char *, const char *);
+static wchar_t *convert(const char *);
+static int  inlcmp(const char *, const char *);
+static void show(FILE *, const char *);
+static wchar_t *skip(wchar_t *);
+static void obsolete(char *[]);
 static void usage(void);
 
 int
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
exit(0);
 }
 
-wchar_t *
+static wchar_t *
 convert(const char *str)
 {
size_t n;
@@ -218,7 +218,7 @@ convert(const char *str)
return (ret);
 }
 
-int
+static int
 inlcmp(const char *s1, const char *s2)
 {
int c1, c2;
@@ -241,7 +241,7 @@ inlcmp(const char *s1, const char *s2)
  * Output a line depending on the flags and number of repetitions
  * of the line.
  */
-void
+static void
 show(FILE *ofp, const char *str)
 {
 
@@ -251,7 +251,7 @@ show(FILE *ofp, const char *str)
(void)fprintf(ofp, "%s", str);
 }
 
-wchar_t *
+static wchar_t *
 skip(wchar_t *str)
 {
int nchars, nfields;
@@ -267,7 +267,7 @@ skip(wchar_t *str)
return(str);
 }
 
-FILE *
+static FILE *
 file(const char *name, const char *mode)
 {
FILE *fp;
@@ -277,7 +277,7 @@ file(const char *name, const char *mode)
return(fp);
 }
 
-void
+static void
 obsolete(char *argv[])
 {
int len;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227192 - head/usr.bin/unexpand

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:05 2011
New Revision: 227192
URL: http://svn.freebsd.org/changeset/base/227192

Log:
  Add missing static keywords to unexpand(1)

Modified:
  head/usr.bin/unexpand/unexpand.c

Modified: head/usr.bin/unexpand/unexpand.c
==
--- head/usr.bin/unexpand/unexpand.cSun Nov  6 08:17:59 2011
(r227191)
+++ head/usr.bin/unexpand/unexpand.cSun Nov  6 08:18:05 2011
(r227192)
@@ -55,9 +55,9 @@ static const char sccsid[] = "@(#)unexpa
 #include 
 #include 
 
-intall;
-intnstops;
-inttabstops[100];
+static int all;
+static int nstops;
+static int tabstops[100];
 
 static void getstops(const char *);
 static void usage(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227194 - head/usr.bin/units

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:17 2011
New Revision: 227194
URL: http://svn.freebsd.org/changeset/base/227194

Log:
  Add missing static keywords to units(1)

Modified:
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.c
==
--- head/usr.bin/units/units.c  Sun Nov  6 08:18:11 2011(r227193)
+++ head/usr.bin/units/units.c  Sun Nov  6 08:18:17 2011(r227194)
@@ -42,9 +42,9 @@ static const char rcsid[] =
 
 #define PRIMITIVECHAR '!'
 
-const char *powerstring = "^";
+static const char *powerstring = "^";
 
-struct {
+static struct {
char *uname;
char *uval;
 }  unittable[MAXUNITS];
@@ -57,13 +57,13 @@ struct unittype {
int quantity;
 };
 
-struct {
+static struct {
char *prefixname;
char *prefixval;
 }  prefixtable[MAXPREFIXES];
 
 
-char NULLUNIT[] = "";
+static char NULLUNIT[] = "";
 
 #ifdef MSDOS
 #define SEPARATOR  ";"
@@ -71,8 +71,8 @@ char NULLUNIT[] = "";
 #define SEPARATOR  ":"
 #endif
 
-int unitcount;
-int prefixcount;
+static int unitcount;
+static int prefixcount;
 
 char   *dupstr(const char *str);
 voidreadunits(const char *userfile);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227195 - head/usr.bin/usbhidaction

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:23 2011
New Revision: 227195
URL: http://svn.freebsd.org/changeset/base/227195

Log:
  Add missing static keywords to usbhidaction(1)

Modified:
  head/usr.bin/usbhidaction/usbhidaction.c

Modified: head/usr.bin/usbhidaction/usbhidaction.c
==
--- head/usr.bin/usbhidaction/usbhidaction.cSun Nov  6 08:18:17 2011
(r227194)
+++ head/usr.bin/usbhidaction/usbhidaction.cSun Nov  6 08:18:23 2011
(r227195)
@@ -64,7 +64,7 @@ struct command {
char *name;
char *action;
 };
-struct command *commands;
+static struct command *commands;
 
 #define SIZE 4000
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227197 - head/usr.bin/uuencode

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:35 2011
New Revision: 227197
URL: http://svn.freebsd.org/changeset/base/227197

Log:
  Add missing static keywords to uuencode(1)

Modified:
  head/usr.bin/uuencode/uuencode.c

Modified: head/usr.bin/uuencode/uuencode.c
==
--- head/usr.bin/uuencode/uuencode.cSun Nov  6 08:18:30 2011
(r227196)
+++ head/usr.bin/uuencode/uuencode.cSun Nov  6 08:18:35 2011
(r227197)
@@ -60,13 +60,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-void encode(void);
-void base64_encode(void);
+static void encode(void);
+static void base64_encode(void);
 static void usage(void);
 
-FILE *output;
-int mode;
-char **av;
+static FILE *output;
+static int mode;
+static char **av;
 
 int
 main(int argc, char *argv[])
@@ -138,7 +138,7 @@ main(int argc, char *argv[])
 /*
  * Copy from in to out, encoding in base64 as you go along.
  */
-void
+static void
 base64_encode(void)
 {
/*
@@ -168,7 +168,7 @@ base64_encode(void)
 /*
  * Copy from in to out, encoding as you go along.
  */
-void
+static void
 encode(void)
 {
register int ch, n;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227196 - head/usr.bin/usbhidctl

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:30 2011
New Revision: 227196
URL: http://svn.freebsd.org/changeset/base/227196

Log:
  Add missing static keywords to usbhidctl(1)

Modified:
  head/usr.bin/usbhidctl/usbhid.c

Modified: head/usr.bin/usbhidctl/usbhid.c
==
--- head/usr.bin/usbhidctl/usbhid.c Sun Nov  6 08:18:23 2011
(r227195)
+++ head/usr.bin/usbhidctl/usbhid.c Sun Nov  6 08:18:30 2011
(r227196)
@@ -42,7 +42,7 @@
 #include 
 #include 
 
-struct variable {
+static struct variable {
char *name;
int instance;
int val;
@@ -50,11 +50,11 @@ struct variable {
struct variable *next;
 } *vars;
 
-int verbose = 0;
-int noname = 0;
-int hexdump = 0;
-int wflag = 0;
-int zflag = 0;
+static int verbose = 0;
+static int noname = 0;
+static int hexdump = 0;
+static int wflag = 0;
+static int zflag = 0;
 
 static void usage(void);
 static void dumpitem(const char *label, struct hid_item *h);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227198 - head/usr.bin/vis

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:42 2011
New Revision: 227198
URL: http://svn.freebsd.org/changeset/base/227198

Log:
  Add missing static keywords to vis(1)

Modified:
  head/usr.bin/vis/vis.c

Modified: head/usr.bin/vis/vis.c
==
--- head/usr.bin/vis/vis.c  Sun Nov  6 08:18:35 2011(r227197)
+++ head/usr.bin/vis/vis.c  Sun Nov  6 08:18:42 2011(r227198)
@@ -50,9 +50,12 @@ static const char sccsid[] = "@(#)vis.c  
 
 #include "extern.h"
 
-int eflags, fold, foldwidth=80, none, markeol, debug;
+static int eflags, fold, foldwidth = 80, none, markeol;
+#ifdef DEBUG
+static int debug;
+#endif
 
-void process(FILE *);
+static void process(FILE *);
 static void usage(void);
 
 int
@@ -133,7 +136,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 process(FILE *fp)
 {
static int col = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227199 - head/usr.bin/w

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:47 2011
New Revision: 227199
URL: http://svn.freebsd.org/changeset/base/227199

Log:
  Add missing static keywords to w(1)

Modified:
  head/usr.bin/w/w.c

Modified: head/usr.bin/w/w.c
==
--- head/usr.bin/w/w.c  Sun Nov  6 08:18:42 2011(r227198)
+++ head/usr.bin/w/w.c  Sun Nov  6 08:18:47 2011(r227199)
@@ -85,25 +85,24 @@ static const char sccsid[] = "@(#)w.c   8.
 
 #include "extern.h"
 
-struct timeval boottime;
-struct utmpx   *utmp;
-struct winsize ws;
-kvm_t *kd;
-time_t now;/* the current time of day */
-intttywidth;   /* width of tty */
-intargwidth;   /* width of tty */
-intheader = 1; /* true if -h flag: don't print heading */
-intnflag;  /* true if -n flag: don't convert addrs */
-intdflag;  /* true if -d flag: output debug info */
-intsortidle;   /* sort by idle time */
+static struct utmpx *utmp;
+static struct winsize ws;
+static kvm_t   *kd;
+static time_t  now;/* the current time of day */
+static int ttywidth;   /* width of tty */
+static int argwidth;   /* width of tty */
+static int header = 1; /* true if -h flag: don't print heading */
+static int nflag;  /* true if -n flag: don't convert addrs */
+static int dflag;  /* true if -d flag: output debug info */
+static int sortidle;   /* sort by idle time */
 intuse_ampm;   /* use AM/PM time */
-int use_comma;  /* use comma as floats separator */
-char **sel_users;  /* login array of particular users selected */
+static int use_comma;  /* use comma as floats separator */
+static char   **sel_users; /* login array of particular users selected */
 
 /*
  * One of these per active utmp entry.
  */
-struct entry {
+static struct entry {
struct  entry *next;
struct  utmpx utmp;
dev_t   tdev;   /* dev_t of terminal */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227200 - head/usr.bin/wall

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:18:55 2011
New Revision: 227200
URL: http://svn.freebsd.org/changeset/base/227200

Log:
  Add missing static keywords to wall(1)

Modified:
  head/usr.bin/wall/wall.c

Modified: head/usr.bin/wall/wall.c
==
--- head/usr.bin/wall/wall.cSun Nov  6 08:18:47 2011(r227199)
+++ head/usr.bin/wall/wall.cSun Nov  6 08:18:55 2011(r227200)
@@ -68,14 +68,14 @@ static const char sccsid[] = "@(#)wall.c
 static void makemsg(char *);
 static void usage(void);
 
-struct wallgroup {
+static struct wallgroup {
struct wallgroup *next;
char*name;
gid_t   gid;
 } *grouplist;
-int nobanner;
-int mbufsize;
-char *mbuf;
+static int nobanner;
+static int mbufsize;
+static char *mbuf;
 
 static int
 ttystat(char *line)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227201 - head/usr.bin/wc

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 08:19:00 2011
New Revision: 227201
URL: http://svn.freebsd.org/changeset/base/227201

Log:
  Add missing static keywords to wc(1)

Modified:
  head/usr.bin/wc/wc.c

Modified: head/usr.bin/wc/wc.c
==
--- head/usr.bin/wc/wc.cSun Nov  6 08:18:55 2011(r227200)
+++ head/usr.bin/wc/wc.cSun Nov  6 08:19:00 2011(r227201)
@@ -58,8 +58,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-uintmax_t tlinect, twordct, tcharct, tlongline;
-int doline, doword, dochar, domulti, dolongline;
+static uintmax_t tlinect, twordct, tcharct, tlongline;
+static int doline, doword, dochar, domulti, dolongline;
 static volatile sig_atomic_t siginfo;
 
 static voidshow_cnt(const char *file, uintmax_t linect, uintmax_t wordct,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227203 - head/usr.bin/id

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 09:09:45 2011
New Revision: 227203
URL: http://svn.freebsd.org/changeset/base/227203

Log:
  Correct the change made in r227166.
  
  This function is only compiled in when building WITH_AUDIT.

Modified:
  head/usr.bin/id/id.c

Modified: head/usr.bin/id/id.c
==
--- head/usr.bin/id/id.cSun Nov  6 08:19:07 2011(r227202)
+++ head/usr.bin/id/id.cSun Nov  6 09:09:45 2011(r227203)
@@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$");
 static voidid_print(struct passwd *, int, int, int);
 static voidpline(struct passwd *);
 static voidpretty(struct passwd *);
+#ifdef USE_BSM_AUDIT
 static voidauditid(void);
+#endif
 static voidgroup(struct passwd *, int);
 static voidmaclabel(void);
 static voidusage(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r227156 - head/usr.bin/cmp

2011-11-06 Thread Peter Jeremy
On 2011-Nov-06 08:14:16 +, Ed Schouten  wrote:
>Log:
>  Add missing static keywords to cmp(1)
>
>Modified:
>  head/usr.bin/cmp/extern.h
>
>Modified: head/usr.bin/cmp/extern.h
>==
>--- head/usr.bin/cmp/extern.h  Sun Nov  6 08:14:09 2011(r227155)
>+++ head/usr.bin/cmp/extern.h  Sun Nov  6 08:14:16 2011(r227156)
>@@ -42,4 +42,4 @@ void c_special(int, const char *, off_t,
> void  diffmsg(const char *, const char *, off_t, off_t);
> void  eofmsg(const char *);
> 
>-extern int lflag, sflag, xflag;
>+extern int lflag, sflag, xflag, zflag;

That's an interesting spelling of "static".  I presume this is a
general cleanup of identifier visibility to prevent unexpected
aliasing - in which case a more general log message may have nicer.

-- 
Peter Jeremy


pgp1NnvPnC9Bj.pgp
Description: PGP signature


svn commit: r227204 - head/sys/netinet

2011-11-06 Thread Mikolaj Golub
Author: trociny
Date: Sun Nov  6 09:17:48 2011
New Revision: 227204
URL: http://svn.freebsd.org/changeset/base/227204

Log:
  Fix the typo made in r157474.
  
  MFC after:3 days

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Sun Nov  6 09:09:45 2011(r227203)
+++ head/sys/netinet/in_pcb.c   Sun Nov  6 09:17:48 2011(r227204)
@@ -590,7 +590,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 * being in use (for now).  This is better
 * than a panic, but not desirable.
 */
-   tw = intotw(inp);
+   tw = intotw(t);
if (tw == NULL ||
(reuseport & tw->tw_so_options) == 0)
return (EADDRINUSE);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227206 - head/sys/netinet6

2011-11-06 Thread Mikolaj Golub
Author: trociny
Date: Sun Nov  6 09:29:52 2011
New Revision: 227206
URL: http://svn.freebsd.org/changeset/base/227206

Log:
  Before dereferencing intotw() check for NULL, the same way as it is
  done for in_pcb (see r157474).
  
  MFC after:1 week

Modified:
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet6/in6_pcb.c
==
--- head/sys/netinet6/in6_pcb.c Sun Nov  6 09:27:40 2011(r227205)
+++ head/sys/netinet6/in6_pcb.c Sun Nov  6 09:29:52 2011(r227206)
@@ -187,6 +187,7 @@ in6_pcbbind(register struct inpcb *inp, 
}
if (lport) {
struct inpcb *t;
+   struct tcptw *tw;
 
/* GROSS */
if (ntohs(lport) <= V_ipport_reservedhigh &&
@@ -233,10 +234,21 @@ in6_pcbbind(register struct inpcb *inp, 
}
t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr,
lport, lookupflags, cred);
-   if (t && (reuseport & ((t->inp_flags & INP_TIMEWAIT) ?
-   intotw(t)->tw_so_options :
-   t->inp_socket->so_options)) == 0)
+   if (t && (t->inp_flags & INP_TIMEWAIT)) {
+   /*
+* XXXRW: If an incpb has had its timewait
+* state recycled, we treat the address as
+* being in use (for now).  This is better
+* than a panic, but not desirable.
+*/
+   tw = intotw(t);
+   if (tw == NULL ||
+   (reuseport & tw->tw_so_options) == 0)
+   return (EADDRINUSE);
+   } else if (t && (reuseport & t->inp_socket->so_options)
+   == 0) {
return (EADDRINUSE);
+   }
 #ifdef INET
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 &&
IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
@@ -246,9 +258,11 @@ in6_pcbbind(register struct inpcb *inp, 
t = in_pcblookup_local(pcbinfo, sin.sin_addr,
lport, lookupflags, cred);
if (t && t->inp_flags & INP_TIMEWAIT) {
-   if ((reuseport &
-   intotw(t)->tw_so_options) == 0 &&
-   (ntohl(t->inp_laddr.s_addr) !=
+   tw = intotw(t);
+   if (tw == NULL)
+   return (EADDRINUSE);
+   if ((reuseport & tw->tw_so_options) == 0
+   && (ntohl(t->inp_laddr.s_addr) !=
 INADDR_ANY || ((inp->inp_vflag &
 INP_IPV6PROTO) ==
 (t->inp_vflag & INP_IPV6PROTO
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r227156 - head/usr.bin/cmp

2011-11-06 Thread Ed Schouten
* Peter Jeremy , 2006 10:10:
> That's an interesting spelling of "static".  I presume this is a
> general cleanup of identifier visibility to prevent unexpected
> aliasing - in which case a more general log message may have nicer.

Yes, sorry about that. When I read through the diff, I overlooked that
there were a small number of changes in there that don't mark things
static, but instead mark them extern.

In the case for cmp, simply all the `*flag' variables were marked extern
anyway, so I decided not to deviate from that for `zflag'.

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgpKx4LyUMvS1.pgp
Description: PGP signature


svn commit: r227207 - in head/sys: netinet netinet6

2011-11-06 Thread Mikolaj Golub
Author: trociny
Date: Sun Nov  6 10:47:20 2011
New Revision: 227207
URL: http://svn.freebsd.org/changeset/base/227207

Log:
  Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid
  inp_socket->so_options dereference when we may not acquire the lock on
  the inpcb.
  
  This fixes the crash due to NULL pointer dereference in
  in_pcbbind_setup() when inp_socket->so_options in a pcb returned by
  in_pcblookup_local() was checked.
  
  Reported by:  dave jones , Arnaud Lacombe 

  Suggested by: rwatson
  Glanced by:   rwatson
  Tested by:dave jones 

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet/ip_output.c
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Sun Nov  6 09:29:52 2011(r227206)
+++ head/sys/netinet/in_pcb.c   Sun Nov  6 10:47:20 2011(r227207)
@@ -575,8 +575,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 ntohl(t->inp_faddr.s_addr) == INADDR_ANY) 
&&
(ntohl(sin->sin_addr.s_addr) != INADDR_ANY 
||
 ntohl(t->inp_laddr.s_addr) != INADDR_ANY ||
-(t->inp_socket->so_options &
-SO_REUSEPORT) == 0) &&
+(t->inp_flags2 & INP_REUSEPORT) == 0) &&
(inp->inp_cred->cr_uid !=
 t->inp_cred->cr_uid))
return (EADDRINUSE);
@@ -594,15 +593,15 @@ in_pcbbind_setup(struct inpcb *inp, stru
if (tw == NULL ||
(reuseport & tw->tw_so_options) == 0)
return (EADDRINUSE);
-   } else if (t &&
-   (reuseport & t->inp_socket->so_options) == 0) {
+   } else if (t && (reuseport == 0 ||
+   (t->inp_flags2 & INP_REUSEPORT) == 0)) {
 #ifdef INET6
if (ntohl(sin->sin_addr.s_addr) !=
INADDR_ANY ||
ntohl(t->inp_laddr.s_addr) !=
INADDR_ANY ||
-   INP_SOCKAF(so) ==
-   INP_SOCKAF(t->inp_socket))
+   (inp->inp_vflag & INP_IPV6PROTO) == 0 ||
+   (t->inp_vflag & INP_IPV6PROTO) == 0)
 #endif
return (EADDRINUSE);
}

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Sun Nov  6 09:29:52 2011(r227206)
+++ head/sys/netinet/in_pcb.h   Sun Nov  6 10:47:20 2011(r227207)
@@ -540,6 +540,7 @@ voidinp_4tuple_get(struct inpcb *inp, 
 #defineINP_LLE_VALID   0x0001 /* cached lle is valid */
 #defineINP_RT_VALID0x0002 /* cached rtentry is valid */
 #defineINP_PCBGROUPWILD0x0004 /* in pcbgroup wildcard list 
*/
+#defineINP_REUSEPORT   0x0008 /* SO_REUSEPORT option is 
set */
 
 /*
  * Flags passed to in_pcblookup*() functions.

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cSun Nov  6 09:29:52 2011
(r227206)
+++ head/sys/netinet/ip_output.cSun Nov  6 10:47:20 2011
(r227207)
@@ -895,12 +895,43 @@ ip_ctloutput(struct socket *so, struct s
 
error = optval = 0;
if (sopt->sopt_level != IPPROTO_IP) {
-   if ((sopt->sopt_level == SOL_SOCKET) &&
-   (sopt->sopt_name == SO_SETFIB)) {
-   inp->inp_inc.inc_fibnum = so->so_fibnum;
-   return (0);
+   error = EINVAL;
+
+   if (sopt->sopt_level == SOL_SOCKET &&
+   sopt->sopt_dir == SOPT_SET) {
+   switch (sopt->sopt_name) {
+   case SO_REUSEADDR:
+   INP_WLOCK(inp);
+   if (IN_MULTICAST(ntohl(inp->inp_laddr.s_addr))) 
{
+   if ((so->so_options &
+   (SO_REUSEADDR | SO_REUSEPORT)) != 0)
+   inp->inp_flags2 |= 
INP_REUSEPORT;
+   else
+   inp->inp_flags2 &= 
~INP_REUSEPORT;
+   }
+   INP_WUNLOCK(inp);
+   error = 0;
+ 

Re: svn commit: r227207 - in head/sys: netinet netinet6

2011-11-06 Thread Mikolaj Golub

On Sun, 6 Nov 2011 10:47:20 + (UTC) Mikolaj Golub wrote:

 MG> Author: trociny
 MG> Date: Sun Nov  6 10:47:20 2011
 MG> New Revision: 227207
 MG> URL: http://svn.freebsd.org/changeset/base/227207

 MG> Log:
 MG>   Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid
 MG>   inp_socket->so_options dereference when we may not acquire the lock on
 MG>   the inpcb.
 MG>   
 MG>   This fixes the crash due to NULL pointer dereference in
 MG>   in_pcbbind_setup() when inp_socket->so_options in a pcb returned by
 MG>   in_pcblookup_local() was checked.
 MG>   
 MG>   Reported by:dave jones , Arnaud Lacombe 

 MG>   Suggested by:rwatson
 MG>   Glanced by:rwatson
 MG>   Tested by:dave jones 

This commit fixes the panic reported by Dave for 9.0 triggered by
named. Robert has helped very much suggesting the solution and looking
at the patches.  Unfortunately being saturated on free time he
couldn't do thorough review of the final version confirming only that
presumably the approach was correct.

I made an effort to check that there was no regression and SO_REUSEADDR
worked the same way as it had worked before. But I can't be 100% confident
that I haven't broken something. Because of this I am going to MFC
only after the release.

Here is the initial discussion of the issue:

http://lists.freebsd.org/pipermail/freebsd-net/2011-September/029858.html


 MG> Modified:
 MG>   head/sys/netinet/in_pcb.c
 MG>   head/sys/netinet/in_pcb.h
 MG>   head/sys/netinet/ip_output.c
 MG>   head/sys/netinet6/in6_pcb.c
 MG>   head/sys/netinet6/ip6_output.c

 MG> Modified: head/sys/netinet/in_pcb.c
 MG> 
==
 MG> --- head/sys/netinet/in_pcb.cSun Nov  6 09:29:52 2011
(r227206)
 MG> +++ head/sys/netinet/in_pcb.cSun Nov  6 10:47:20 2011
(r227207)
 MG> @@ -575,8 +575,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 MG>   ntohl(t->inp_faddr.s_addr) == 
INADDR_ANY) &&
 MG>  (ntohl(sin->sin_addr.s_addr) != 
INADDR_ANY ||
 MG>   ntohl(t->inp_laddr.s_addr) != 
INADDR_ANY ||
 MG> - (t->inp_socket->so_options &
 MG> - SO_REUSEPORT) == 0) &&
 MG> + (t->inp_flags2 & INP_REUSEPORT) == 
0) &&
 MG>  (inp->inp_cred->cr_uid !=
 MG>   t->inp_cred->cr_uid))
 MG>  return (EADDRINUSE);
 MG> @@ -594,15 +593,15 @@ in_pcbbind_setup(struct inpcb *inp, stru
 MG>  if (tw == NULL ||
 MG>  (reuseport & tw->tw_so_options) == 0)
 MG>  return (EADDRINUSE);
 MG> -} else if (t &&
 MG> -(reuseport & t->inp_socket->so_options) == 0) 
{
 MG> +} else if (t && (reuseport == 0 ||
 MG> +(t->inp_flags2 & INP_REUSEPORT) == 0)) {
 MG>  #ifdef INET6
 MG>  if (ntohl(sin->sin_addr.s_addr) !=
 MG>  INADDR_ANY ||
 MG>  ntohl(t->inp_laddr.s_addr) !=
 MG>  INADDR_ANY ||
 MG> -INP_SOCKAF(so) ==
 MG> -INP_SOCKAF(t->inp_socket))
 MG> +(inp->inp_vflag & INP_IPV6PROTO) == 0 
||
 MG> +(t->inp_vflag & INP_IPV6PROTO) == 0)
 MG>  #endif
 MG>  return (EADDRINUSE);
 MG>  }

 MG> Modified: head/sys/netinet/in_pcb.h
 MG> 
==
 MG> --- head/sys/netinet/in_pcb.hSun Nov  6 09:29:52 2011
(r227206)
 MG> +++ head/sys/netinet/in_pcb.hSun Nov  6 10:47:20 2011
(r227207)
 MG> @@ -540,6 +540,7 @@ void inp_4tuple_get(struct inpcb *inp, 
 MG>  #defineINP_LLE_VALID0x0001 /* cached lle is 
valid */
 MG>  #defineINP_RT_VALID0x0002 /* cached rtentry 
is valid */
 MG>  #defineINP_PCBGROUPWILD0x0004 /* in pcbgroup wildcard 
list */
 MG> +#defineINP_REUSEPORT0x0008 /* SO_REUSEPORT 
option is set */
 MG>  
 MG>  /*
 MG>   * Flags passed to in_pcblookup*() functions.

 MG> Modified: head/sys/netinet/ip_output.c
 MG> 
==
 MG> --- head/sys/netinet/ip_output.cSun Nov  6 09:29:52 2011
(r227206)
 MG> +++ head/sys/netinet/ip_output.cSun Nov  6 10:47:20 2011
(r227207)
 MG> @@ -895,12 

svn commit: r227214 - head

2011-11-06 Thread Antoine Brodin
Author: antoine
Date: Sun Nov  6 14:00:18 2011
New Revision: 227214
URL: http://svn.freebsd.org/changeset/base/227214

Log:
  Add more obsolete files.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sun Nov  6 13:35:55 2011(r227213)
+++ head/ObsoleteFiles.inc  Sun Nov  6 14:00:18 2011(r227214)
@@ -44,10 +44,12 @@ OLD_FILES+=usr/share/man/man8/sysinstall
 OLD_FILES+=usr/lib/libftpio.a
 OLD_FILES+=usr/lib/libftpio.so
 OLD_LIBS+=usr/lib/libftpio.so.8
+OLD_FILES+=usr/lib/libftpio_p.a
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
 OLD_FILES+=usr/lib32/libftpio.a
 OLD_FILES+=usr/lib32/libftpio.so
 OLD_LIBS+=usr/lib32/libftpio.so.8
+OLD_FILES+=usr/lib32/libftpio_p.a
 .endif
 OLD_FILES+=usr/include/ftpio.h
 OLD_FILES+=usr/share/man/man3/ftpio.3.gz
@@ -77,11 +79,22 @@ OLD_LIBS+=usr/lib32/libopie.so.6
 OLD_LIBS+=usr/lib32/librtld_db.so.1
 OLD_LIBS+=usr/lib32/libtacplus.so.4
 .endif
+# 20110817: no more acd.4, ad.4, afd.4 and ast.4
+OLD_FILES+=usr/share/man/man4/acd.4.gz
+OLD_FILES+=usr/share/man/man4/ad.4.gz
+OLD_FILES+=usr/share/man/man4/afd.4.gz
+OLD_FILES+=usr/share/man/man4/ast.4.gz
 # 20110718: no longer useful in the age of rc.d
 OLD_FILES+=usr/sbin/named.reconfig
 OLD_FILES+=usr/sbin/named.reload
+OLD_FILES+=usr/share/man/man8/named.reconfig.8.gz
+OLD_FILES+=usr/share/man/man8/named.reload.8.gz
 # 20110716: bind 9.8.0 import
 OLD_LIBS+=usr/lib/liblwres.so.50
+OLD_FILES+=usr/share/doc/bind9/KNOWN-DEFECTS
+OLD_FILES+=usr/share/doc/bind9/NSEC3-NOTES
+OLD_FILES+=usr/share/doc/bind9/README.idnkit
+OLD_FILES+=usr/share/doc/bind9/README.pkcs11
 # 20110709: vm_map_clean.9 -> vm_map_sync.9
 OLD_FILES+=usr/share/man/man9/vm_map_clean.9.gz
 # 20110709: Catch up with removal of these functions.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227215 - in head: gnu/lib/libstdc++ lib/clang/include/llvm/Config

2011-11-06 Thread Dimitry Andric
Author: dim
Date: Sun Nov  6 14:07:23 2011
New Revision: 227215
URL: http://svn.freebsd.org/changeset/base/227215

Log:
  When one attempts to compile the tree with -march=i386, which also used
  to be gcc's default before r198344, calls to atomic builtins will not be
  expanded inline.  Instead, they will be generated as calls to external
  functions (e.g. __sync_fetch_and_add_N), leading to linking errors later
  on.
  
  Put in a seatbelt that disables use of atomic builtins in libstdc++ and
  llvm, when tuning specifically for the real i386 CPU.  This does not
  protect against all possible issues, but it is better than nothing.

Modified:
  head/gnu/lib/libstdc++/config.h
  head/lib/clang/include/llvm/Config/config.h
  head/lib/clang/include/llvm/Config/llvm-config.h

Modified: head/gnu/lib/libstdc++/config.h
==
--- head/gnu/lib/libstdc++/config.h Sun Nov  6 14:00:18 2011
(r227214)
+++ head/gnu/lib/libstdc++/config.h Sun Nov  6 14:07:23 2011
(r227215)
@@ -671,7 +671,7 @@
 /* #undef VERSION */
 
 /* Define if builtin atomic operations are supported on this host. */
-#if defined(__amd64__) || defined(__i386__)
+#if defined(__amd64__) || (defined(__i386__) && !defined(__tune_i386__))
 #define _GLIBCXX_ATOMIC_BUILTINS 1
 #endif
 

Modified: head/lib/clang/include/llvm/Config/config.h
==
--- head/lib/clang/include/llvm/Config/config.h Sun Nov  6 14:00:18 2011
(r227214)
+++ head/lib/clang/include/llvm/Config/config.h Sun Nov  6 14:07:23 2011
(r227215)
@@ -552,7 +552,9 @@
 /* #undef LLVM_ETCDIR */
 
 /* Has gcc/MSVC atomic intrinsics */
+#ifndef __tune_i386__
 #define LLVM_HAS_ATOMICS 1
+#endif
 
 /* Host triple we were built on */
 /* #undef LLVM_HOSTTRIPLE */

Modified: head/lib/clang/include/llvm/Config/llvm-config.h
==
--- head/lib/clang/include/llvm/Config/llvm-config.hSun Nov  6 14:00:18 
2011(r227214)
+++ head/lib/clang/include/llvm/Config/llvm-config.hSun Nov  6 14:07:23 
2011(r227215)
@@ -34,7 +34,9 @@
 /* #undef LLVM_ETCDIR */
 
 /* Has gcc/MSVC atomic intrinsics */
+#ifndef __tune_i386__
 #define LLVM_HAS_ATOMICS 1
+#endif
 
 /* Host triple we were built on */
 /* #undef LLVM_HOSTTRIPLE */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227221 - head/usr.sbin/timed/timed

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 16:37:15 2011
New Revision: 227221
URL: http://svn.freebsd.org/changeset/base/227221

Log:
  Simplify inclusion of the tsptype array a bit.
  
  We don't need this array in timed.c -- only readmsg.c.

Modified:
  head/usr.sbin/timed/timed/readmsg.c
  head/usr.sbin/timed/timed/timed.c

Modified: head/usr.sbin/timed/timed/readmsg.c
==
--- head/usr.sbin/timed/timed/readmsg.c Sun Nov  6 16:36:54 2011
(r227220)
+++ head/usr.sbin/timed/timed/readmsg.c Sun Nov  6 16:37:15 2011
(r227221)
@@ -35,10 +35,9 @@ static const char rcsid[] =
   "$FreeBSD$";
 #endif /* not lint */
 
+#defineTSPTYPES
 #include "globals.h"
 
-extern char *tsptype[];
-
 /*
  * LOOKAT checks if the message is of the requested type and comes from
  * the right machine, returning 1 in case of affirmative answer

Modified: head/usr.sbin/timed/timed/timed.c
==
--- head/usr.sbin/timed/timed/timed.c   Sun Nov  6 16:36:54 2011
(r227220)
+++ head/usr.sbin/timed/timed/timed.c   Sun Nov  6 16:37:15 2011
(r227221)
@@ -42,7 +42,6 @@ static char sccsid[] = "@(#)timed.c   8.1 
 #include 
 __FBSDID("$FreeBSD$");
 
-#define TSPTYPES
 #include "globals.h"
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227223 - head/usr.sbin/chroot

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 16:40:17 2011
New Revision: 227223
URL: http://svn.freebsd.org/changeset/base/227223

Log:
  Eliminate global variables.
  
  There is no reason why these three variables should be declared as
  global variables, while the others aren't. They are only used inside
  main().

Modified:
  head/usr.sbin/chroot/chroot.c

Modified: head/usr.sbin/chroot/chroot.c
==
--- head/usr.sbin/chroot/chroot.c   Sun Nov  6 16:37:50 2011
(r227222)
+++ head/usr.sbin/chroot/chroot.c   Sun Nov  6 16:40:17 2011
(r227223)
@@ -56,16 +56,12 @@ __FBSDID("$FreeBSD$");
 
 static void usage(void);
 
-char   *user;  /* user to switch to before running program */
-char   *group; /* group to switch to ... */
-char   *grouplist; /* group list to switch to ... */
-
 int
 main(int argc, char *argv[])
 {
struct group*gp;
struct passwd   *pw;
-   char*endp, *p;
+   char*endp, *p, *user, *group, *grouplist;
const char  *shell;
gid_t   gid, *gidlist;
uid_t   uid;
@@ -74,6 +70,7 @@ main(int argc, char *argv[])
 
gid = 0;
uid = 0;
+   user = group = grouplist = NULL;
while ((ch = getopt(argc, argv, "G:g:u:")) != -1) {
switch(ch) {
case 'u':
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227224 - head/usr.sbin/mptable

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 16:47:50 2011
New Revision: 227224
URL: http://svn.freebsd.org/changeset/base/227224

Log:
  Mark all global variables static for mptable(1).
  
  While there, remove basetableEntryTypes, which became unused in r71209.

Modified:
  head/usr.sbin/mptable/mptable.c

Modified: head/usr.sbin/mptable/mptable.c
==
--- head/usr.sbin/mptable/mptable.c Sun Nov  6 16:40:17 2011
(r227223)
+++ head/usr.sbin/mptable/mptable.c Sun Nov  6 16:47:50 2011
(r227224)
@@ -96,7 +96,7 @@ typedef struct BUSTYPENAME {
 char   name[ 7 ];
 } busTypeName;
 
-static busTypeName busTypeTable[] =
+static const busTypeName busTypeTable[] =
 {
 { CBUS,"CBUS"   },
 { CBUSII,  "CBUSII" },
@@ -119,7 +119,7 @@ static busTypeName busTypeTable[] =
 { UNKNOWN_BUSTYPE, "---"}
 };
 
-const char* whereStrings[] = {
+static const char *whereStrings[] = {
 "Extended BIOS Data Area",
 "BIOS top of memory",
 "Default top of memory",
@@ -135,16 +135,7 @@ typedef struct TABLE_ENTRY {
 char   name[ 32 ];
 } tableEntry;
 
-tableEntry basetableEntryTypes[] =
-{
-{ 0, 20, "Processor" },
-{ 1,  8, "Bus" },
-{ 2,  8, "I/O APIC" },
-{ 3,  8, "I/O INT" },
-{ 4,  8, "Local INT" }
-};
-
-tableEntry extendedtableEntryTypes[] =
+static const tableEntry extendedtableEntryTypes[] =
 {
 { 128, 20, "System Address Space" },
 { 129,  8, "Bus Hierarchy" },
@@ -277,19 +268,19 @@ static void doDmesg( void );
 static void pnstr( char* s, int c );
 
 /* global data */
-intpfd;/* physical /dev/mem fd */
+static int pfd;/* physical /dev/mem fd */
 
-intbusses[ 16 ];
-intapics[ 16 ];
+static int busses[16];
+static int apics[16];
 
-intncpu;
-intnbus;
-intnapic;
-intnintr;
-
-intdmesg;
-intgrope;
-intverbose;
+static int ncpu;
+static int nbus;
+static int napic;
+static int nintr;
+
+static int dmesg;
+static int grope;
+static int verbose;
 
 static void
 usage( void )
@@ -978,14 +969,14 @@ ioApicEntry( void )
 }
 
 
-const char* intTypes[] = {
+static const char *intTypes[] = {
 "INT", "NMI", "SMI", "ExtINT"
 };
 
-const char* polarityMode[] = {
+static const char *polarityMode[] = {
 "conforms", "active-hi", "reserved", "active-lo"
 };
-const char* triggerMode[] = {
+static const char *triggerMode[] = {
 "conforms", "edge", "reserved", "level"
 };
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227225 - head/usr.sbin/cdcontrol

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 16:52:26 2011
New Revision: 227225
URL: http://svn.freebsd.org/changeset/base/227225

Log:
  Make all functions and global variables static for cdcontrol(8).
  
  While there, replace __const by const, which seems to be our preference
  nowadays. Also fix some style(9) bugs by adding newlines and removing
  unneeded spaces from function declarations.

Modified:
  head/usr.sbin/cdcontrol/cdcontrol.c

Modified: head/usr.sbin/cdcontrol/cdcontrol.c
==
--- head/usr.sbin/cdcontrol/cdcontrol.c Sun Nov  6 16:47:50 2011
(r227224)
+++ head/usr.sbin/cdcontrol/cdcontrol.c Sun Nov  6 16:52:26 2011
(r227225)
@@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$");
 #define STATUS_MEDIA   0x2
 #define STATUS_VOLUME  0x4
 
-struct cmdtab {
+static struct cmdtab {
int command;
const char *name;
unsigned min;
@@ -119,40 +119,40 @@ struct cmdtab {
 { 0,   NULL,   0, NULL }
 };
 
-struct cd_toc_entrytoc_buffer[100];
+static struct cd_toc_entry toc_buffer[100];
 
-const char *cdname;
-intfd = -1;
-intverbose = 1;
-intmsf = 1;
-
-int setvol(int, int);
-int read_toc_entrys(int);
-int play_msf(int, int, int, int, int, int);
-int play_track(int, int, int, int);
-int get_vol(int *, int *);
-int status(int *, int *, int *, int *);
-int open_cd(void);
-int next_prev(char *arg, int);
-int play(char *arg);
-int info(char *arg);
-int cdid(void);
-int pstatus(char *arg);
-char   *input(int *);
-voidprtrack(struct cd_toc_entry *e, int lastflag);
-voidlba2msf(unsigned long lba, u_char *m, u_char *s, u_char *f);
-unsigned intmsf2lba(u_char m, u_char s, u_char f);
-int play_blocks(int blk, int len);
-int run(int cmd, char *arg);
-char   *parse(char *buf, int *cmd);
-voidhelp(void);
-voidusage(void);
-char   *use_cdrom_instead(const char *);
-__const char   *strstatus(int);
+static const char *cdname;
+static int fd = -1;
+static int verbose = 1;
+static int msf = 1;
+
+static int  setvol(int, int);
+static int  read_toc_entrys(int);
+static int  play_msf(int, int, int, int, int, int);
+static int  play_track(int, int, int, int);
+static int  status(int *, int *, int *, int *);
+static int  open_cd(void);
+static int  next_prev(char *arg, int);
+static int  play(char *arg);
+static int  info(char *arg);
+static int  cdid(void);
+static int  pstatus(char *arg);
+static char*input(int *);
+static void prtrack(struct cd_toc_entry *e, int lastflag);
+static void lba2msf(unsigned long lba, u_char *m, u_char *s, u_char *f);
+static unsigned int msf2lba(u_char m, u_char s, u_char f);
+static int  play_blocks(int blk, int len);
+static int  run(int cmd, char *arg);
+static char*parse(char *buf, int *cmd);
+static void help(void);
+static void usage(void);
+static char*use_cdrom_instead(const char *);
+static const char *strstatus(int);
 static u_intdbprog_discid(void);
-__const char   *cdcontrol_prompt(void);
+static const char *cdcontrol_prompt(void);
 
-void help (void)
+static void
+help(void)
 {
struct cmdtab *c;
const char *s;
@@ -178,13 +178,15 @@ void help (void)
printf ("\tThe plain target address is taken as a synonym for play.\n");
 }
 
-void usage (void)
+static void
+usage(void)
 {
fprintf (stderr, "usage: cdcontrol [-sv] [-f device] [command ...]\n");
exit (1);
 }
 
-char *use_cdrom_instead(const char *old_envvar)
+static char *
+use_cdrom_instead(const char *old_envvar)
 {
char *device;
 
@@ -196,7 +198,8 @@ char *use_cdrom_instead(const char *old_
 }
 
 
-int main (int argc, char **argv)
+int
+main(int argc, char **argv)
 {
int cmd;
char *arg;
@@ -284,7 +287,8 @@ int main (int argc, char **argv)
}
 }
 
-int run (int cmd, char *arg)
+static int
+run(int cmd, char *arg)
 {
long speed;
int l, r, rc, count;
@@ -465,7 +469,8 @@ int run (int cmd, char *arg)
}
 }
 
-int play (char *arg)
+static int
+play(char *arg)
 {
struct ioc_toc_header h;
unsigned int n;
@@ -748,7 +753,8 @@ Clean_up:
return (0);
 }
 
-int next_prev (char *arg, int cmd)
+static int
+next_prev(char *arg, int cmd)
 {
struct ioc_toc_header h;
int dir, junk, n, off, rc, trk;
@@ -778,7 +784,8 @@ int next_prev (char *arg, int cmd)
return (play_track (trk, 1, n, 1));
 }
 
-const char *strstatus (int sts)
+static const char *
+strstatus(int sts)
 {
switch (sts) {
case ASTS_INVALID:  return ("invalid");
@@ -791,7 +798,8 @@ const char *strstatus (int sts)
}
 }
 
-int pstatus (char *arg)
+static i

svn commit: r227228 - head/usr.bin/chpass

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 17:20:44 2011
New Revision: 227228
URL: http://svn.freebsd.org/changeset/base/227228

Log:
  Mark the structure fields as const.
  
  This allows us to simply place these strings as constants in the table
  itself, letting the compiler decide to simply merge duplicate strings.

Modified:
  head/usr.bin/chpass/chpass.h
  head/usr.bin/chpass/table.c

Modified: head/usr.bin/chpass/chpass.h
==
--- head/usr.bin/chpass/chpass.hSun Nov  6 16:58:17 2011
(r227227)
+++ head/usr.bin/chpass/chpass.hSun Nov  6 17:20:44 2011
(r227228)
@@ -48,7 +48,7 @@ typedef struct _entry {
int (*func)(char *, struct passwd *, struct _entry *);
int restricted;
size_t len;
-   char *except, *save;
+   const char *except, *save;
 } ENTRY;
 
 /* Field numbers. */

Modified: head/usr.bin/chpass/table.c
==
--- head/usr.bin/chpass/table.c Sun Nov  6 16:58:17 2011(r227227)
+++ head/usr.bin/chpass/table.c Sun Nov  6 17:20:44 2011(r227228)
@@ -39,27 +39,24 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "chpass.h"
 
-char e1[] = ": ";
-char e2[] = ":,";
-
 ENTRY list[] = {
-   { "login",  p_login,  1,   5, e1,   NULL },
-   { "password",   p_passwd, 1,   8, e1,   NULL },
-   { "uid",p_uid,1,   3, e1,   NULL },
-   { "gid",p_gid,1,   3, e1,   NULL },
-   { "class",  p_class,  1,   5, e1,   NULL },
+   { "login",  p_login,  1,   5, ": ", NULL },
+   { "password",   p_passwd, 1,   8, ": ", NULL },
+   { "uid",p_uid,1,   3, ": ", NULL },
+   { "gid",p_gid,1,   3, ": ", NULL },
+   { "class",  p_class,  1,   5, ": ", NULL },
{ "change", p_change, 1,   6, NULL, NULL },
{ "expire", p_expire, 1,   6, NULL, NULL },
 #ifdef RESTRICT_FULLNAME_CHANGE/* do not allow fullname 
changes */
-   { "full name",  p_gecos,  1,   9, e2,   NULL },
+   { "full name",  p_gecos,  1,   9, ":,", NULL },
 #else
-   { "full name",  p_gecos,  0,   9, e2,   NULL },
+   { "full name",  p_gecos,  0,   9, ":,", NULL },
 #endif
-   { "office phone",   p_gecos,  0,  12, e2,   NULL },
-   { "home phone", p_gecos,  0,  10, e2,   NULL },
-   { "office location",p_gecos,  0,  15, e2,   NULL },
-   { "other information",  p_gecos,  0,  11, e1,   NULL },
-   { "home directory", p_hdir,   1,  14, e1,   NULL },
-   { "shell",  p_shell,  0,   5, e1,   NULL },
+   { "office phone",   p_gecos,  0,  12, ":,", NULL },
+   { "home phone", p_gecos,  0,  10, ":,", NULL },
+   { "office location",p_gecos,  0,  15, ":,", NULL },
+   { "other information",  p_gecos,  0,  11, ": ", NULL },
+   { "home directory", p_hdir,   1,  14, ": ", NULL },
+   { "shell",  p_shell,  0,   5, ": ", NULL },
{ NULL, NULL, 0, 0, NULL, NULL },
 };
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227231 - head/sbin/bsdlabel

2011-11-06 Thread Andrey V. Elsukov
Author: ae
Date: Sun Nov  6 17:30:32 2011
New Revision: 227231
URL: http://svn.freebsd.org/changeset/base/227231

Log:
  To be in sync with GEOM_PART_BSD limit the maximum number of supported
  partitions to 20.
  
  MFC after:1 week

Modified:
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==
--- head/sbin/bsdlabel/bsdlabel.c   Sun Nov  6 17:25:22 2011
(r227230)
+++ head/sbin/bsdlabel/bsdlabel.c   Sun Nov  6 17:30:32 2011
(r227231)
@@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #define DKTYPENAMES
 #define FSTYPENAMES
-#define MAXPARTITIONS  26
+#define MAXPARTITIONS  20
 #include 
 
 #include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227233 - head/usr.bin/at

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 17:32:29 2011
New Revision: 227233
URL: http://svn.freebsd.org/changeset/base/227233

Log:
  Add missing static keywords to at(1).
  
  While there, tidy up the privs.h part, where at.c has to #define to
  declare some globals. Also group static and non-static global variables
  in at.c.

Modified:
  head/usr.bin/at/at.c
  head/usr.bin/at/parsetime.c
  head/usr.bin/at/privs.h

Modified: head/usr.bin/at/at.c
==
--- head/usr.bin/at/at.cSun Nov  6 17:31:57 2011(r227232)
+++ head/usr.bin/at/at.cSun Nov  6 17:32:29 2011(r227233)
@@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$");
 #include "panic.h"
 #include "parsetime.h"
 #include "perm.h"
-
-#define MAIN
 #include "privs.h"
 
 /* Macros */
@@ -90,22 +88,22 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* w
 
 /* File scope variables */
 
-const char *no_export[] =
-{
+static const char *no_export[] = {
 "TERM", "TERMCAP", "DISPLAY", "_"
-} ;
+};
 static int send_mail = 0;
+static char *atinput = NULL;   /* where to get input from */
+static char atqueue = 0;   /* which queue to examine for jobs (atq) */
 
 /* External variables */
 
 extern char **environ;
 int fcreated;
 char atfile[] = ATJOB_DIR "12345678901234";
-
-char *atinput = (char*)0;  /* where to get input from */
-char atqueue = 0;  /* which queue to examine for jobs (atq) */
 char atverify = 0; /* verify time instead of queuing job */
 char *namep;
+uid_t real_uid, effective_uid;
+gid_t real_gid, effective_gid;
 
 /* Function declarations */
 

Modified: head/usr.bin/at/parsetime.c
==
--- head/usr.bin/at/parsetime.c Sun Nov  6 17:31:57 2011(r227232)
+++ head/usr.bin/at/parsetime.c Sun Nov  6 17:32:29 2011(r227233)
@@ -72,7 +72,7 @@ enum {/* symbols */
 
 /* parse translation table - table driven parsers can be your FRIEND!
  */
-struct {
+static const struct {
 const char *name;  /* token name */
 int value; /* token id */
 int plural;/* is this plural? */

Modified: head/usr.bin/at/privs.h
==
--- head/usr.bin/at/privs.h Sun Nov  6 17:31:57 2011(r227232)
+++ head/usr.bin/at/privs.h Sun Nov  6 17:32:29 2011(r227233)
@@ -59,15 +59,8 @@
  * to the real userid before calling any of them.
  */
 
-#ifndef MAIN
-extern
-#endif
-uid_t real_uid, effective_uid;
-
-#ifndef MAIN 
-extern
-#endif
-gid_t real_gid, effective_gid;
+extern uid_t real_uid, effective_uid;
+extern gid_t real_gid, effective_gid;
 
 #define RELINQUISH_PRIVS { \
real_uid = getuid(); \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227234 - head/usr.bin/checknr

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:03 2011
New Revision: 227234
URL: http://svn.freebsd.org/changeset/base/227234

Log:
  Mark global functions and/or variables in checknr(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/checknr/checknr.c

Modified: head/usr.bin/checknr/checknr.c
==
--- head/usr.bin/checknr/checknr.c  Sun Nov  6 17:32:29 2011
(r227233)
+++ head/usr.bin/checknr/checknr.c  Sun Nov  6 18:49:03 2011
(r227234)
@@ -59,34 +59,34 @@ __FBSDID("$FreeBSD$");
 #define MAXBR  100 /* Max number of bracket pairs known */
 #define MAXCMDS500 /* Max number of commands known */
 
-void addcmd(char *);
-void addmac(const char *);
-int binsrch(const char *);
-void checkknown(const char *);
-void chkcmd(const char *, const char *);
-void complain(int);
-int eq(const char *, const char *);
-void nomatch(const char *);
-void pe(int);
-void process(FILE *);
-void prop(int);
+static void addcmd(char *);
+static void addmac(const char *);
+static int binsrch(const char *);
+static void checkknown(const char *);
+static void chkcmd(const char *, const char *);
+static void complain(int);
+static int eq(const char *, const char *);
+static void nomatch(const char *);
+static void pe(int);
+static void process(FILE *);
+static void prop(int);
 static void usage(void);
 
 /*
  * The stack on which we remember what we've seen so far.
  */
-struct stkstr {
+static struct stkstr {
int opno;   /* number of opening bracket */
int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */
int parm;   /* parm to size, font, etc */
int lno;/* line number */
 } stk[MAXSTK];
-int stktop;
+static int stktop;
 
 /*
  * The kinds of opening and closing brackets.
  */
-struct brstr {
+static struct brstr {
const char *opbr;
const char *clbr;
 } br[MAXBR] = {
@@ -145,7 +145,7 @@ struct brstr {
  * All commands known to nroff, plus macro packages.
  * Used so we can complain about unrecognized commands.
  */
-const char *knowncmds[MAXCMDS] = {
+static const char *knowncmds[MAXCMDS] = {
 "$c", "$f", "$h", "$p", "$s", "(b", "(c", "(d", "(f", "(l", "(q", "(t",
 "(x", "(z", ")b", ")c", ")d", ")f", ")l", ")q", ")t", ")x", ")z", "++",
 "+c", "1C", "1c", "2C", "2c", "@(", "@)", "@C", "@D", "@F", "@I", "@M",
@@ -179,13 +179,13 @@ const char *knowncmds[MAXCMDS] = {
 "yr", 0
 };
 
-intlineno; /* current line number in input file */
-const char *cfilename; /* name of current file */
-intnfiles; /* number of files to process */
-intfflag;  /* -f: ignore \f */
-intsflag;  /* -s: ignore \s */
-intncmds;  /* size of knowncmds */
-intslot;   /* slot in knowncmds found by binsrch */
+static int lineno; /* current line number in input file */
+static const char *cfilename;  /* name of current file */
+static int nfiles; /* number of files to process */
+static int fflag;  /* -f: ignore \f */
+static int sflag;  /* -s: ignore \s */
+static int ncmds;  /* size of knowncmds */
+static int slot;   /* slot in knowncmds found by binsrch */
 
 int
 main(int argc, char **argv)
@@ -275,7 +275,7 @@ usage(void)
exit(1);
 }
 
-void
+static void
 process(FILE *f)
 {
int i, n;
@@ -372,7 +372,7 @@ process(FILE *f)
}
 }
 
-void
+static void
 complain(int i)
 {
pe(stk[i].lno);
@@ -381,7 +381,7 @@ complain(int i)
printf("\n");
 }
 
-void
+static void
 prop(int i)
 {
if (stk[i].pl == 0)
@@ -399,7 +399,7 @@ prop(int i)
}
 }
 
-void
+static void
 chkcmd(const char *line __unused, const char *mac)
 {
int i;
@@ -435,7 +435,7 @@ chkcmd(const char *line __unused, const 
}
 }
 
-void
+static void
 nomatch(const char *mac)
 {
int i, j;
@@ -480,14 +480,14 @@ nomatch(const char *mac)
 }
 
 /* eq: are two strings equal? */
-int
+static int
 eq(const char *s1, const char *s2)
 {
return (strcmp(s1, s2) == 0);
 }
 
 /* print the first part of an error message, given the line number */
-void
+static void
 pe(int linen)
 {
if (nfiles > 1)
@@ -495,7 +495,7 @@ pe(int linen)
printf("%d: ", linen);
 }
 
-void
+static void
 checkknown(const char *mac)
 {
 
@@ -513,7 +513,7 @@ checkknown(const char *mac)
 /*
  * We have a .de xx line in "line".  Add xx to the list of known commands.
  */
-void
+static void
 addcmd(char *line)
 {
char *mac;
@@ -544,7 +544,7 @@ addcmd(char *line)
  * me someday?)  Anyway, I claim that .de is fairly rare in user
  * nroff programs, and the register loop below is pretty fast.
  */
-void
+static void
 addmac(const char *mac)
 {
const char **src, **dest, **loc;
@@ -575,7 +575,7 @@ printf("after: %s %s %s %s %s, %d cmds\n
  * Do a binary search in knownc

svn commit: r227235 - head/usr.bin/comm

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:10 2011
New Revision: 227235
URL: http://svn.freebsd.org/changeset/base/227235

Log:
  Mark global functions and/or variables in comm(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/comm/comm.c

Modified: head/usr.bin/comm/comm.c
==
--- head/usr.bin/comm/comm.cSun Nov  6 18:49:03 2011(r227234)
+++ head/usr.bin/comm/comm.cSun Nov  6 18:49:10 2011(r227235)
@@ -57,12 +57,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-int iflag;
-const char *tabs[] = { "", "\t", "\t\t" };
+static int iflag;
+static const char *tabs[] = { "", "\t", "\t\t" };
 
-FILE   *file(const char *);
-wchar_t*convert(const char *);
-void   show(FILE *, const char *, const char *, char **, size_t *);
+static FILE*file(const char *);
+static wchar_t *convert(const char *);
+static voidshow(FILE *, const char *, const char *, char **, size_t *);
 static voidusage(void);
 
 int
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
exit(0);
 }
 
-wchar_t *
+static wchar_t *
 convert(const char *str)
 {
size_t n;
@@ -212,7 +212,7 @@ convert(const char *str)
return (buf);
 }
 
-void
+static void
 show(FILE *fp, const char *fn, const char *offset, char **bufp, size_t 
*buflenp)
 {
ssize_t n;
@@ -228,7 +228,7 @@ show(FILE *fp, const char *fn, const cha
err(1, "%s", fn);
 }
 
-FILE *
+static FILE *
 file(const char *name)
 {
FILE *fp;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227236 - head/usr.bin/compress

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:16 2011
New Revision: 227236
URL: http://svn.freebsd.org/changeset/base/227236

Log:
  Mark global functions and/or variables in compress(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/compress/compress.c

Modified: head/usr.bin/compress/compress.c
==
--- head/usr.bin/compress/compress.cSun Nov  6 18:49:10 2011
(r227235)
+++ head/usr.bin/compress/compress.cSun Nov  6 18:49:16 2011
(r227236)
@@ -56,15 +56,15 @@ __FBSDID("$FreeBSD$");
 
 #include "zopen.h"
 
-void   compress(const char *, const char *, int);
-void   cwarn(const char *, ...) __printflike(1, 2);
-void   cwarnx(const char *, ...) __printflike(1, 2);
-void   decompress(const char *, const char *, int);
-intpermission(const char *);
-void   setfile(const char *, struct stat *);
-void   usage(int);
+static voidcompress(const char *, const char *, int);
+static voidcwarn(const char *, ...) __printflike(1, 2);
+static voidcwarnx(const char *, ...) __printflike(1, 2);
+static voiddecompress(const char *, const char *, int);
+static int permission(const char *);
+static voidsetfile(const char *, struct stat *);
+static voidusage(int);
 
-int eval, force, verbose;
+static int eval, force, verbose;
 
 int
 main(int argc, char *argv[])
@@ -191,7 +191,7 @@ main(int argc, char *argv[])
exit (eval);
 }
 
-void
+static void
 compress(const char *in, const char *out, int bits)
 {
size_t nr;
@@ -281,7 +281,7 @@ err:if (ofp) {
(void)fclose(ifp);
 }
 
-void
+static void
 decompress(const char *in, const char *out, int bits)
 {
size_t nr;
@@ -357,7 +357,7 @@ err:if (ofp) {
(void)fclose(ifp);
 }
 
-void
+static void
 setfile(const char *name, struct stat *fs)
 {
static struct timeval tv[2];
@@ -387,7 +387,7 @@ setfile(const char *name, struct stat *f
cwarn("chflags: %s", name);
 }
 
-int
+static int
 permission(const char *fname)
 {
int ch, first;
@@ -401,7 +401,7 @@ permission(const char *fname)
return (first == 'y');
 }
 
-void
+static void
 usage(int iscompress)
 {
if (iscompress)
@@ -413,7 +413,7 @@ usage(int iscompress)
exit(1);
 }
 
-void
+static void
 cwarnx(const char *fmt, ...)
 {
va_list ap;
@@ -424,7 +424,7 @@ cwarnx(const char *fmt, ...)
eval = 1;
 }
 
-void
+static void
 cwarn(const char *fmt, ...)
 {
va_list ap;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227237 - head/usr.bin/enigma

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:23 2011
New Revision: 227237
URL: http://svn.freebsd.org/changeset/base/227237

Log:
  Mark global functions and/or variables in enigma(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/enigma/enigma.c

Modified: head/usr.bin/enigma/enigma.c
==
--- head/usr.bin/enigma/enigma.cSun Nov  6 18:49:16 2011
(r227236)
+++ head/usr.bin/enigma/enigma.cSun Nov  6 18:49:23 2011
(r227237)
@@ -25,16 +25,16 @@ __FBSDID("$FreeBSD$");
 #define ECHO 010
 #define ROTORSZ 256
 #define MASK 0377
-char   t1[ROTORSZ];
-char   t2[ROTORSZ];
-char   t3[ROTORSZ];
-char   deck[ROTORSZ];
-char   buf[13];
+static chart1[ROTORSZ];
+static chart2[ROTORSZ];
+static chart3[ROTORSZ];
+static chardeck[ROTORSZ];
+static charbuf[13];
 
-void   shuffle(char *);
-void   setup(char *);
+static voidshuffle(char *);
+static voidsetup(char *);
 
-void
+static void
 setup(char *pw)
 {
int ic, i, k, temp;
@@ -128,7 +128,7 @@ main(int argc, char *argv[])
return 0;
 }
 
-void
+static void
 shuffle(char deckary[])
 {
int i, ic, k, temp;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227238 - head/usr.bin/expand

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:30 2011
New Revision: 227238
URL: http://svn.freebsd.org/changeset/base/227238

Log:
  Mark global functions and/or variables in expand(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/expand/expand.c

Modified: head/usr.bin/expand/expand.c
==
--- head/usr.bin/expand/expand.cSun Nov  6 18:49:23 2011
(r227237)
+++ head/usr.bin/expand/expand.cSun Nov  6 18:49:30 2011
(r227238)
@@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$");
 /*
  * expand - expand tabs to equivalent spaces
  */
-intnstops;
-inttabstops[100];
+static int nstops;
+static int tabstops[100];
 
 static void getstops(char *);
 static void usage(void);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227239 - head/usr.bin/fstat

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:36 2011
New Revision: 227239
URL: http://svn.freebsd.org/changeset/base/227239

Log:
  Mark global functions and/or variables in fstat(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/fstat/fstat.c
  head/usr.bin/fstat/fuser.c

Modified: head/usr.bin/fstat/fstat.c
==
--- head/usr.bin/fstat/fstat.c  Sun Nov  6 18:49:30 2011(r227238)
+++ head/usr.bin/fstat/fstat.c  Sun Nov  6 18:49:36 2011(r227239)
@@ -57,13 +57,13 @@ __FBSDID("$FreeBSD$");
 
 #include "functions.h"
 
-intfsflg,  /* show files on same filesystem as file(s) argument */
-   pflg,   /* show files open by a particular pid */
-   uflg;   /* show files open by a particular (effective) user */
-intcheckfile; /* true if restricting to particular files or filesystems */
-intnflg;   /* (numerical) display f.s. and rdev as dev_t */
-intmflg;   /* include memory-mapped files */
-intvflg;   /* be verbose */
+static int fsflg,  /* show files on same filesystem as file(s) argument */
+   pflg,   /* show files open by a particular pid */
+   uflg;   /* show files open by a particular (effective) user */
+static int checkfile; /* restrict to particular files or filesystems */
+static int nflg;   /* (numerical) display f.s. and rdev as dev_t */
+static int mflg;   /* include memory-mapped files */
+static int vflg;   /* be verbose */
 
 typedef struct devs {
struct devs *next;
@@ -72,8 +72,8 @@ typedef struct devs {
const char  *name;
 } DEVS;
 
-DEVS *devs;
-char *memf, *nlistf;
+static DEVS *devs;
+static char *memf, *nlistf;
 
 static int getfname(const char *filename);
 static voiddofiles(struct procstat *procstat, struct kinfo_proc *p);

Modified: head/usr.bin/fstat/fuser.c
==
--- head/usr.bin/fstat/fuser.c  Sun Nov  6 18:49:30 2011(r227238)
+++ head/usr.bin/fstat/fuser.c  Sun Nov  6 18:49:36 2011(r227239)
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
 /*
  * File access mode flags table.
  */
-struct {
+static const struct {
int flag;
charch;
 } fflags[] = {
@@ -67,7 +67,7 @@ struct {
 /*
  * Usage flags translation table.
  */
-struct {
+static const struct {
int flag;
charch;
 } uflags[] = {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227240 - head/usr.bin/lam

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:41 2011
New Revision: 227240
URL: http://svn.freebsd.org/changeset/base/227240

Log:
  Mark global functions and/or variables in lam(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/lam/lam.c

Modified: head/usr.bin/lam/lam.c
==
--- head/usr.bin/lam/lam.c  Sun Nov  6 18:49:36 2011(r227239)
+++ head/usr.bin/lam/lam.c  Sun Nov  6 18:49:41 2011(r227240)
@@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
 #defineMAXOFILES   20
 #defineBIGBUFSIZ   5 * BUFSIZ
 
-struct openfile {  /* open file structure */
+static struct openfile {   /* open file structure */
FILE*fp;/* file pointer */
short   eof;/* eof flag */
short   pad;/* pad flag for missing columns */
@@ -64,10 +64,10 @@ struct  openfile {  /* open file structur
const char *format; /* printf(3) style string spec. */
 }  input[MAXOFILES];
 
-intmorefiles;  /* set by getargs(), changed by gatherline() */
-intnofinalnl;  /* normally append \n to each output line */
-char   line[BIGBUFSIZ];
-char   *linep;
+static int morefiles;  /* set by getargs(), changed by gatherline() */
+static int nofinalnl;  /* normally append \n to each output line */
+static charline[BIGBUFSIZ];
+static char*linep;
 
 static char*gatherline(struct openfile *);
 static voidgetargs(char *[]);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227241 - head/usr.bin/m4

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:48 2011
New Revision: 227241
URL: http://svn.freebsd.org/changeset/base/227241

Log:
  Mark global functions and/or variables in m4(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/m4/gnum4.c
  head/usr.bin/m4/main.c

Modified: head/usr.bin/m4/gnum4.c
==
--- head/usr.bin/m4/gnum4.c Sun Nov  6 18:49:41 2011(r227240)
+++ head/usr.bin/m4/gnum4.c Sun Nov  6 18:49:48 2011(r227241)
@@ -60,7 +60,7 @@ int mimic_gnu = 0;
  * Then M4PATH env variable
  */
 
-struct path_entry {
+static struct path_entry {
char *name;
struct path_entry *next;
 } *first, *last;

Modified: head/usr.bin/m4/main.c
==
--- head/usr.bin/m4/main.c  Sun Nov  6 18:49:41 2011(r227240)
+++ head/usr.bin/m4/main.c  Sun Nov  6 18:49:48 2011(r227241)
@@ -99,7 +99,7 @@ char scommt[MAXCCHARS+1] = {SCOMMT};  /* 
 char ecommt[MAXCCHARS+1] = {ECOMMT};   /* end character for comment   */
 int synccpp;   /* Line synchronisation for C preprocessor */
 
-struct keyblk keywrds[] = {/* m4 keywords to be installed */
+static const struct keyblk keywrds[] = { /* m4 keywords to be installed */
{ "include",  INCLTYPE },
{ "sinclude", SINCTYPE },
{ "define",   DEFITYPE },
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227242 - head/usr.bin/paste

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:49:53 2011
New Revision: 227242
URL: http://svn.freebsd.org/changeset/base/227242

Log:
  Mark global functions and/or variables in paste(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/paste/paste.c

Modified: head/usr.bin/paste/paste.c
==
--- head/usr.bin/paste/paste.c  Sun Nov  6 18:49:48 2011(r227241)
+++ head/usr.bin/paste/paste.c  Sun Nov  6 18:49:53 2011(r227242)
@@ -57,15 +57,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-wchar_t *delim;
-int delimcnt;
+static wchar_t *delim;
+static int delimcnt;
 
-int parallel(char **);
-int sequential(char **);
-int tr(wchar_t *);
+static int parallel(char **);
+static int sequential(char **);
+static int tr(wchar_t *);
 static void usage(void);
 
-wchar_t tab[] = L"\t";
+static wchar_t tab[] = L"\t";
 
 int
 main(int argc, char *argv[])
@@ -125,7 +125,7 @@ typedef struct _list {
char *name;
 } LIST;
 
-int
+static int
 parallel(char **argv)
 {
LIST *lp;
@@ -195,7 +195,7 @@ parallel(char **argv)
return (0);
 }
 
-int
+static int
 sequential(char **argv)
 {
FILE *fp;
@@ -235,7 +235,7 @@ sequential(char **argv)
return (failed != 0);
 }
 
-int
+static int
 tr(wchar_t *arg)
 {
int cnt;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227243 - head/usr.bin/unifdef

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:50:00 2011
New Revision: 227243
URL: http://svn.freebsd.org/changeset/base/227243

Log:
  Mark global functions and/or variables in unifdef(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/unifdef/unifdef.c

Modified: head/usr.bin/unifdef/unifdef.c
==
--- head/usr.bin/unifdef/unifdef.c  Sun Nov  6 18:49:53 2011
(r227242)
+++ head/usr.bin/unifdef/unifdef.c  Sun Nov  6 18:50:00 2011
(r227243)
@@ -56,7 +56,7 @@
 #include 
 #include 
 
-const char copyright[] =
+static const char copyright[] =
 "@(#) $Version: unifdef-2.5.6.21f1388 $\n"
 "@(#) $FreeBSD$\n"
 "@(#) $Author: Tony Finch (d...@dotat.at) $\n"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227244 - head/usr.bin/whereis

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:50:19 2011
New Revision: 227244
URL: http://svn.freebsd.org/changeset/base/227244

Log:
  Mark global functions and/or variables in whereis(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/whereis/whereis.c

Modified: head/usr.bin/whereis/whereis.c
==
--- head/usr.bin/whereis/whereis.c  Sun Nov  6 18:50:00 2011
(r227243)
+++ head/usr.bin/whereis/whereis.c  Sun Nov  6 18:50:19 2011
(r227244)
@@ -56,18 +56,18 @@ __FBSDID("$FreeBSD$");
 
 typedef const char *ccharp;
 
-int opt_a, opt_b, opt_m, opt_q, opt_s, opt_u, opt_x;
-ccharp *bindirs, *mandirs, *sourcedirs;
-char **query;
-
-const char *sourcepath = PATH_SOURCES;
-
-char   *colonify(ccharp *);
-int contains(ccharp *, const char *);
-voiddecolonify(char *, ccharp **, int *);
-voiddefaults(void);
-voidscanopts(int, char **);
-voidusage(void);
+static int opt_a, opt_b, opt_m, opt_q, opt_s, opt_u, opt_x;
+static ccharp *bindirs, *mandirs, *sourcedirs;
+static char **query;
+
+static const char *sourcepath = PATH_SOURCES;
+
+static char*colonify(ccharp *);
+static int  contains(ccharp *, const char *);
+static void decolonify(char *, ccharp **, int *);
+static void defaults(void);
+static void scanopts(int, char **);
+static void usage(void);
 
 /*
  * Throughout this program, a number of strings are dynamically
@@ -85,7 +85,7 @@ void   usage(void);
  * abort(3) in case of an allocation failure.
  */
 
-void
+static void
 usage(void)
 {
(void)fprintf(stderr,
@@ -99,7 +99,7 @@ usage(void)
  * Note that the -B/-M/-S options expect a list of directory
  * names that must be terminated with -f.
  */
-void
+static void
 scanopts(int argc, char **argv)
 {
int c, i;
@@ -174,7 +174,7 @@ scanopts(int argc, char **argv)
 /*
  * Find out whether string `s' is contained in list `cpp'.
  */
-int
+static int
 contains(ccharp *cpp, const char *s)
 {
ccharp cp;
@@ -197,7 +197,7 @@ contains(ccharp *cpp, const char *s)
  * partial string is only added if it has a length greater than 0, and
  * if it's not already contained in the string list.
  */
-void
+static void
 decolonify(char *s, ccharp **cppp, int *ip)
 {
char *cp;
@@ -223,7 +223,7 @@ decolonify(char *s, ccharp **cppp, int *
 /*
  * Join string list `cpp' into a colon-separated string.
  */
-char *
+static char *
 colonify(ccharp *cpp)
 {
size_t s;
@@ -249,7 +249,7 @@ colonify(ccharp *cpp)
 /*
  * Provide defaults for all options and directory lists.
  */
-void
+static void
 defaults(void)
 {
size_t s;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227245 - head/usr.bin/which

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:50:26 2011
New Revision: 227245
URL: http://svn.freebsd.org/changeset/base/227245

Log:
  Mark global functions and/or variables in which(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/which/which.c

Modified: head/usr.bin/which/which.c
==
--- head/usr.bin/which/which.c  Sun Nov  6 18:50:19 2011(r227244)
+++ head/usr.bin/which/which.c  Sun Nov  6 18:50:26 2011(r227245)
@@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$");
 static void usage(void);
 static int  print_matches(char *, char *);

-intsilent;
-intallpaths;
+static int  silent;
+static int  allpaths;
 
 int
 main(int argc, char **argv)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227246 - head/usr.bin/whois

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:50:33 2011
New Revision: 227246
URL: http://svn.freebsd.org/changeset/base/227246

Log:
  Mark global functions and/or variables in whois(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.c
==
--- head/usr.bin/whois/whois.c  Sun Nov  6 18:50:26 2011(r227245)
+++ head/usr.bin/whois/whois.c  Sun Nov  6 18:50:33 2011(r227246)
@@ -81,9 +81,9 @@ __FBSDID("$FreeBSD$");
 
 #define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-')
 
-const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST,
-  FNICHOST, NULL };
-const char *port = DEFAULT_PORT;
+static const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST,
+ FNICHOST, NULL };
+static const char *port = DEFAULT_PORT;
 
 static char *choose_server(char *);
 static struct addrinfo *gethostinfo(char const *host, int exit_on_error);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227247 - head/usr.bin/xstr

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 18:50:39 2011
New Revision: 227247
URL: http://svn.freebsd.org/changeset/base/227247

Log:
  Mark global functions and/or variables in xstr(1) static where possible.
  
  This allows compilers and static analyzers to more thorough analysis.

Modified:
  head/usr.bin/xstr/xstr.c

Modified: head/usr.bin/xstr/xstr.c
==
--- head/usr.bin/xstr/xstr.cSun Nov  6 18:50:33 2011(r227246)
+++ head/usr.bin/xstr/xstr.cSun Nov  6 18:50:39 2011(r227247)
@@ -62,35 +62,35 @@ static const char sccsid[] = "@(#)xstr.c
 
 #defineignore(a)   ((void) a)
 
-off_t  tellpt;
+static off_t   tellpt;
 
-off_t  mesgpt;
-char   cstrings[] ="strings";
-char   *strings =  cstrings;
+static off_t   mesgpt;
+static charcstrings[] ="strings";
+static char*strings =  cstrings;
 
-intcflg;
-intvflg;
-intreadstd;
+static int cflg;
+static int vflg;
+static int readstd;
 
-char lastchr(char *);
+static char lastchr(char *);
 
-int fgetNUL(char *, int, FILE *);
-int istail(char *, char *);
-int octdigit(char);
-int xgetc(FILE *);
+static int fgetNUL(char *, int, FILE *);
+static int istail(char *, char *);
+static int octdigit(char);
+static int xgetc(FILE *);
 
-off_t hashit(char *, int);
-off_t yankstr(char **);
+static off_t hashit(char *, int);
+static off_t yankstr(char **);
 
 static void usage(void);
 
-void flushsh(void);
-void found(int, off_t, char *);
-void inithash(void);
-void onintr(int);
-void process(const char *);
-void prstr(char *);
-void xsdotc(void);
+static void flushsh(void);
+static void found(int, off_t, char *);
+static void inithash(void);
+static void onintr(int);
+static void process(const char *);
+static void prstr(char *);
+static void xsdotc(void);
 
 int
 main(int argc, char *argv[])
@@ -155,9 +155,9 @@ usage(void)
exit (1);
 }
 
-char linebuf[BUFSIZ];
+static char linebuf[BUFSIZ];
 
-void
+static void
 process(const char *name)
 {
char *cp;
@@ -225,7 +225,7 @@ out:
warn("x.c"), onintr(0);
 }
 
-off_t
+static off_t
 yankstr(char **cpp)
 {
char *cp = *cpp;
@@ -285,13 +285,13 @@ out:
return (hashit(dbuf, 1));
 }
 
-int
+static int
 octdigit(char c)
 {
return (isdigit(c) && c != '8' && c != '9');
 }
 
-void
+static void
 inithash(void)
 {
char buf[BUFSIZ];
@@ -308,7 +308,7 @@ inithash(void)
ignore(fclose(mesgread));
 }
 
-int
+static int
 fgetNUL(char *obuf, int rmdr, FILE *file)
 {
int c;
@@ -320,7 +320,7 @@ fgetNUL(char *obuf, int rmdr, FILE *file
return ((feof(file) || ferror(file)) ? 0 : 1);
 }
 
-int
+static int
 xgetc(FILE *file)
 {
 
@@ -330,14 +330,14 @@ xgetc(FILE *file)
 
 #defineBUCKETS 128
 
-struct hash {
+static struct hash {
off_t   hpt;
char*hstr;
struct  hash *hnext;
short   hnew;
 } bucket[BUCKETS];
 
-off_t
+static off_t
 hashit(char *str, int new)
 {
int i;
@@ -362,7 +362,7 @@ hashit(char *str, int new)
return (hp->hpt);
 }
 
-void
+static void
 flushsh(void)
 {
int i;
@@ -395,7 +395,7 @@ flushsh(void)
err(4, "%s", strings);
 }
 
-void
+static void
 found(int new, off_t off, char *str)
 {
if (vflg == 0)
@@ -408,7 +408,7 @@ found(int new, off_t off, char *str)
fprintf(stderr, "\n");
 }
 
-void
+static void
 prstr(char *cp)
 {
int c;
@@ -424,7 +424,7 @@ prstr(char *cp)
fprintf(stderr, "%c", c);
 }
 
-void
+static void
 xsdotc(void)
 {
FILE *strf = fopen(strings, "r");
@@ -459,7 +459,7 @@ out:
ignore(fclose(strf));
 }
 
-char
+static char
 lastchr(char *cp)
 {
 
@@ -468,7 +468,7 @@ lastchr(char *cp)
return (*cp);
 }
 
-int
+static int
 istail(char *str, char *of)
 {
int d = strlen(of) - strlen(str);
@@ -478,7 +478,7 @@ istail(char *str, char *of)
return (d);
 }
 
-void
+static void
 onintr(int dummy __unused)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227248 - head/sbin/bsdlabel

2011-11-06 Thread Andrey V. Elsukov
Author: ae
Date: Sun Nov  6 18:59:42 2011
New Revision: 227248
URL: http://svn.freebsd.org/changeset/base/227248

Log:
  bsdlabel(8) could automatically fill many of disklabel's deprecated
  fields, but user could specify some of those fields when edits disklabel
  with `bsdlabel -e`. But without -A flag these fields might be
  overwritten with default values from the virgin disklabel.
  So, don't overwrite such fields if they are not zero. Also add checks
  to prevent creating disklabel with less than DEFPARTITIONS and more
  than MAXPARTITIONS partitions.
  
  PR:   bin/162332
  Tested by:Eugene Grosbein
  MFC after:1 week

Modified:
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==
--- head/sbin/bsdlabel/bsdlabel.c   Sun Nov  6 18:50:39 2011
(r227247)
+++ head/sbin/bsdlabel/bsdlabel.c   Sun Nov  6 18:59:42 2011
(r227248)
@@ -836,6 +836,11 @@ getasciilabel(FILE *f, struct disklabel 
"line %d: bad # of partitions\n", lineno);
lp->d_npartitions = MAXPARTITIONS;
errors++;
+   } else if (v < DEFPARTITIONS) {
+   fprintf(stderr,
+   "line %d: bad # of partitions\n", lineno);
+   lp->d_npartitions = DEFPARTITIONS;
+   errors++;
} else
lp->d_npartitions = v;
continue;
@@ -1149,23 +1154,42 @@ checklabel(struct disklabel *lp)
errors++;
} else if (lp->d_bbsize % lp->d_secsize)
warnx("boot block size %% sector-size != 0");
-   if (lp->d_npartitions > MAXPARTITIONS)
+   if (lp->d_npartitions > MAXPARTITIONS) {
warnx("number of partitions (%lu) > MAXPARTITIONS (%d)",
(u_long)lp->d_npartitions, MAXPARTITIONS);
+   errors++;
+   }
+   if (lp->d_npartitions < DEFPARTITIONS) {
+   warnx("number of partitions (%lu) < DEFPARTITIONS (%d)",
+   (u_long)lp->d_npartitions, DEFPARTITIONS);
+   errors++;
+   }
} else {
struct disklabel *vl;
 
vl = getvirginlabel();
-   lp->d_secsize = vl->d_secsize;
-   lp->d_nsectors = vl->d_nsectors;
-   lp->d_ntracks = vl->d_ntracks;
-   lp->d_ncylinders = vl->d_ncylinders;
-   lp->d_rpm = vl->d_rpm;
-   lp->d_interleave = vl->d_interleave;
-   lp->d_secpercyl = vl->d_secpercyl;
-   lp->d_secperunit = vl->d_secperunit;
-   lp->d_bbsize = vl->d_bbsize;
-   lp->d_npartitions = vl->d_npartitions;
+   if (lp->d_secsize == 0)
+   lp->d_secsize = vl->d_secsize;
+   if (lp->d_nsectors == 0)
+   lp->d_nsectors = vl->d_nsectors;
+   if (lp->d_ntracks == 0)
+   lp->d_ntracks = vl->d_ntracks;
+   if (lp->d_ncylinders == 0)
+   lp->d_ncylinders = vl->d_ncylinders;
+   if (lp->d_rpm == 0)
+   lp->d_rpm = vl->d_rpm;
+   if (lp->d_interleave == 0)
+   lp->d_interleave = vl->d_interleave;
+   if (lp->d_secpercyl == 0)
+   lp->d_secpercyl = vl->d_secpercyl;
+   if (lp->d_secperunit == 0)
+   lp->d_secperunit = vl->d_secperunit;
+   if (lp->d_bbsize == 0)
+   lp->d_bbsize = vl->d_bbsize;
+   if (lp->d_npartitions == 0 ||
+   lp->d_npartitions < DEFPARTITIONS ||
+   lp->d_npartitions > MAXPARTITIONS)
+   lp->d_npartitions = vl->d_npartitions;
}
 
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227249 - head/usr.sbin/apm

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:01:30 2011
New Revision: 227249
URL: http://svn.freebsd.org/changeset/base/227249

Log:
  Mark global functions and/or variables in apm(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/apm/apm.c

Modified: head/usr.sbin/apm/apm.c
==
--- head/usr.sbin/apm/apm.c Sun Nov  6 18:59:42 2011(r227248)
+++ head/usr.sbin/apm/apm.c Sun Nov  6 19:01:30 2011(r227249)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #define xl(a)  ((a) & 0xff)
 #define APMERR(a) xh(a)
 
-int cmos_wall = 0; /* True when wall time is in cmos clock, else UTC */
+static int cmos_wall = 0; /* True when wall time is in cmos clock, else UTC */
 
 static void
 usage(void)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227250 - head/usr.sbin/boot0cfg

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:01:35 2011
New Revision: 227250
URL: http://svn.freebsd.org/changeset/base/227250

Log:
  Mark global functions and/or variables in boot0cfg(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/boot0cfg/boot0cfg.c

Modified: head/usr.sbin/boot0cfg/boot0cfg.c
==
--- head/usr.sbin/boot0cfg/boot0cfg.c   Sun Nov  6 19:01:30 2011
(r227249)
+++ head/usr.sbin/boot0cfg/boot0cfg.c   Sun Nov  6 19:01:35 2011
(r227250)
@@ -60,13 +60,13 @@ struct opt_offsets {
int ticks;
 };
 
-struct opt_offsets b0_ofs[] = {
+static struct opt_offsets b0_ofs[] = {
{ 0x0, 0x0, 0x0, 0x0 }, /* no boot block */
{ 0x1b9, 0x1ba, 0x1bb, 0x1bc }, /* original block */
{ 0x1b5, 0x1b6, 0x1b7, 0x1bc }, /* NT_SERIAL block */
 };
 
-int b0_ver;/* boot block version set by boot0bs */
+static int b0_ver; /* boot block version set by boot0bs */
 
 #define OFF_OPT(b0_ofs[b0_ver].opt)/* default boot option 
*/
 #define OFF_DRIVE  (b0_ofs[b0_ver].drive)  /* setdrv drive */
@@ -106,9 +106,9 @@ static int argtoi(const char *, int, int
 static int set_bell(u_int8_t *, int, int);
 static void usage(void);
 
-unsigned vol_id[5];/* 4 plus 1 for flag */
+static unsigned vol_id[5]; /* 4 plus 1 for flag */
 
-int v_flag;
+static int v_flag;
 /*
  * Boot manager installation/configuration utility.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227252 - head/usr.sbin/devinfo

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:01:48 2011
New Revision: 227252
URL: http://svn.freebsd.org/changeset/base/227252

Log:
  Mark global functions and/or variables in devinfo(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/devinfo/devinfo.c

Modified: head/usr.sbin/devinfo/devinfo.c
==
--- head/usr.sbin/devinfo/devinfo.c Sun Nov  6 19:01:41 2011
(r227251)
+++ head/usr.sbin/devinfo/devinfo.c Sun Nov  6 19:01:48 2011
(r227252)
@@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "devinfo.h"
 
-intrflag;
-intvflag;
+static int rflag;
+static int vflag;
 
 static voidprint_resource(struct devinfo_res *);
 static int print_device_matching_resource(struct devinfo_res *, void *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227251 - head/usr.sbin/chown

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:01:41 2011
New Revision: 227251
URL: http://svn.freebsd.org/changeset/base/227251

Log:
  Mark global functions and/or variables in chown(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/chown/chown.c

Modified: head/usr.sbin/chown/chown.c
==
--- head/usr.sbin/chown/chown.c Sun Nov  6 19:01:35 2011(r227250)
+++ head/usr.sbin/chown/chown.c Sun Nov  6 19:01:41 2011(r227251)
@@ -57,16 +57,16 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-void   a_gid(const char *);
-void   a_uid(const char *);
-void   chownerr(const char *);
-uid_t  id(const char *, const char *);
-void   usage(void);
-
-uid_t uid;
-gid_t gid;
-int ischown;
-const char *gname;
+static voida_gid(const char *);
+static voida_uid(const char *);
+static voidchownerr(const char *);
+static uid_t   id(const char *, const char *);
+static voidusage(void);
+
+static uid_t uid;
+static gid_t gid;
+static int ischown;
+static const char *gname;
 
 int
 main(int argc, char **argv)
@@ -229,7 +229,7 @@ main(int argc, char **argv)
exit(rval);
 }
 
-void
+static void
 a_gid(const char *s)
 {
struct group *gr;
@@ -240,7 +240,7 @@ a_gid(const char *s)
gid = ((gr = getgrnam(s)) != NULL) ? gr->gr_gid : id(s, "group");
 }
 
-void
+static void
 a_uid(const char *s)
 {
struct passwd *pw;
@@ -250,7 +250,7 @@ a_uid(const char *s)
uid = ((pw = getpwnam(s)) != NULL) ? pw->pw_uid : id(s, "user");
 }
 
-uid_t
+static uid_t
 id(const char *name, const char *type)
 {
uid_t val;
@@ -267,7 +267,7 @@ id(const char *name, const char *type)
return (val);
 }
 
-void
+static void
 chownerr(const char *file)
 {
static uid_t euid = -1;
@@ -299,7 +299,7 @@ chownerr(const char *file)
warn("%s", file);
 }
 
-void
+static void
 usage(void)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227253 - head/usr.sbin/fdread

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:01:54 2011
New Revision: 227253
URL: http://svn.freebsd.org/changeset/base/227253

Log:
  Mark global functions and/or variables in fdread(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/fdread/fdread.c

Modified: head/usr.sbin/fdread/fdread.c
==
--- head/usr.sbin/fdread/fdread.c   Sun Nov  6 19:01:48 2011
(r227252)
+++ head/usr.sbin/fdread/fdread.c   Sun Nov  6 19:01:54 2011
(r227253)
@@ -44,14 +44,14 @@
 
 #include "fdutil.h"
 
-intquiet, recover;
-unsigned char fillbyte = 0xf0; /* "foo" */
+static int quiet, recover;
+static unsigned char fillbyte = 0xf0;  /* "foo" */
 
-intdoread(int fd, FILE *of, const char *_devname);
-intdoreadid(int fd, unsigned int numids, unsigned int trackno);
-void   usage(void);
+static int doread(int fd, FILE *of, const char *_devname);
+static int doreadid(int fd, unsigned int numids, unsigned int trackno);
+static voidusage(void);
 
-void
+static void
 usage(void)
 {
 
@@ -155,7 +155,7 @@ main(int argc, char **argv)
return (numids? doreadid(fd, numids, trackno): doread(fd, of, 
_devname));
 }
 
-int
+static int
 doread(int fd, FILE *of, const char *_devname)
 {
char *trackbuf;
@@ -294,7 +294,7 @@ doread(int fd, FILE *of, const char *_de
return (nerrs? EX_IOERR: EX_OK);
 }
 
-int
+static int
 doreadid(int fd, unsigned int numids, unsigned int trackno)
 {
int rv = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227255 - head/usr.sbin/mixer

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:13 2011
New Revision: 227255
URL: http://svn.freebsd.org/changeset/base/227255

Log:
  Mark global functions and/or variables in mixer(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/mixer/mixer.c

Modified: head/usr.sbin/mixer/mixer.c
==
--- head/usr.sbin/mixer/mixer.c Sun Nov  6 19:01:59 2011(r227254)
+++ head/usr.sbin/mixer/mixer.c Sun Nov  6 19:02:13 2011(r227255)
@@ -24,7 +24,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
+static const char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
 
 static voidusage(int devmask, int recmask);
 static int res_name(const char *name, int mask);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227254 - head/usr.sbin/memcontrol

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:01:59 2011
New Revision: 227254
URL: http://svn.freebsd.org/changeset/base/227254

Log:
  Mark global functions and/or variables in memcontrol(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/memcontrol/memcontrol.c

Modified: head/usr.sbin/memcontrol/memcontrol.c
==
--- head/usr.sbin/memcontrol/memcontrol.c   Sun Nov  6 19:01:54 2011
(r227253)
+++ head/usr.sbin/memcontrol/memcontrol.c   Sun Nov  6 19:01:59 2011
(r227254)
@@ -39,8 +39,7 @@
 #include 
 #include 
 
-struct
-{
+static struct {
 const char *name;
 intval;
 intkind;
@@ -67,8 +66,7 @@ static void   clearfunc(int memfd, int arg
 static voidhelpfunc(int memfd, int argc, char *argv[]);
 static voidhelp(const char *what);
 
-struct 
-{
+static struct {
 const char *cmd;
 const char *desc;
 void   (*func)(int memfd, int argc, char *argv[]);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227256 - head/usr.sbin/moused

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:20 2011
New Revision: 227256
URL: http://svn.freebsd.org/changeset/base/227256

Log:
  Mark global functions and/or variables in moused(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/moused/moused.c

Modified: head/usr.sbin/moused/moused.c
==
--- head/usr.sbin/moused/moused.c   Sun Nov  6 19:02:13 2011
(r227255)
+++ head/usr.sbin/moused/moused.c   Sun Nov  6 19:02:20 2011
(r227256)
@@ -174,14 +174,14 @@ typedef struct {
 
 /* global variables */
 
-intdebug = 0;
-intnodaemon = FALSE;
-intbackground = FALSE;
-intpaused = FALSE;
-intidentify = ID_NONE;
-intextioctl = FALSE;
-const char *pidfile = "/var/run/moused.pid";
-struct pidfh *pfh;
+static int debug = 0;
+static int nodaemon = FALSE;
+static int background = FALSE;
+static int paused = FALSE;
+static int identify = ID_NONE;
+static int extioctl = FALSE;
+static const char *pidfile = "/var/run/moused.pid";
+static struct pidfh *pfh;
 
 #define SCROLL_NOTSCROLLING0
 #define SCROLL_PREPARE 1
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227257 - head/usr.sbin/pwd_mkdb

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:25 2011
New Revision: 227257
URL: http://svn.freebsd.org/changeset/base/227257

Log:
  Mark global functions and/or variables in pwd_mkdb(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/pwd_mkdb/pwd_mkdb.c

Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c
==
--- head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Sun Nov  6 19:02:20 2011
(r227256)
+++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c   Sun Nov  6 19:02:25 2011
(r227257)
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
 #define LEGACY_VERSION(x)  _PW_VERSIONED(x, 3)
 #define CURRENT_VERSION(x) _PW_VERSIONED(x, 4)
 
-HASHINFO openinfo = {
+static HASHINFO openinfo = {
4096,   /* bsize */
32, /* ffactor */
256,/* nelem */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227258 - head/usr.sbin/rip6query

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:31 2011
New Revision: 227258
URL: http://svn.freebsd.org/changeset/base/227258

Log:
  Mark global functions and/or variables in rip6query(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/rip6query/rip6query.c

Modified: head/usr.sbin/rip6query/rip6query.c
==
--- head/usr.sbin/rip6query/rip6query.c Sun Nov  6 19:02:25 2011
(r227257)
+++ head/usr.sbin/rip6query/rip6query.c Sun Nov  6 19:02:31 2011
(r227258)
@@ -56,9 +56,9 @@
 
 #include "route6d.h"
 
-ints;
-struct sockaddr_in6 sin6;
-struct rip6*ripbuf;
+static int s;
+static struct sockaddr_in6 sin6;
+static struct rip6 *ripbuf;
 
 #defineRIPSIZE(n)  (sizeof(struct rip6) + (n-1) * sizeof(struct 
netinfo6))
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227259 - head/usr.sbin/rmt

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:37 2011
New Revision: 227259
URL: http://svn.freebsd.org/changeset/base/227259

Log:
  Mark global functions and/or variables in rmt(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/rmt/rmt.c

Modified: head/usr.sbin/rmt/rmt.c
==
--- head/usr.sbin/rmt/rmt.c Sun Nov  6 19:02:31 2011(r227258)
+++ head/usr.sbin/rmt/rmt.c Sun Nov  6 19:02:37 2011(r227259)
@@ -54,25 +54,25 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-inttape = -1;
+static int tape = -1;
 
-char   *record;
-intmaxrecsize = -1;
+static char*record;
+static int maxrecsize = -1;
 
 #defineSSIZE   64
-char   device[SSIZE];
-char   count[SSIZE], mode[SSIZE], pos[SSIZE], op[SSIZE];
+static chardevice[SSIZE];
+static charcount[SSIZE], mode[SSIZE], pos[SSIZE], op[SSIZE];
 
-char   resp[BUFSIZ];
+static charresp[BUFSIZ];
 
-FILE   *debug;
+static FILE*debug;
 #defineDEBUG(f)if (debug) fprintf(debug, f)
 #defineDEBUG1(f,a) if (debug) fprintf(debug, f, a)
 #defineDEBUG2(f,a1,a2) if (debug) fprintf(debug, f, a1, a2)
 
-char   *checkbuf(char *, int);
-voiderror(int);
-voidgetstring(char *);
+static char*checkbuf(char *, int);
+static void error(int);
+static void getstring(char *);
 
 int
 main(int argc, char **argv)
@@ -220,7 +220,7 @@ getstring(char *bp)
cp[i] = '\0';
 }
 
-char *
+static char *
 checkbuf(char *rec, int size)
 {
 
@@ -240,7 +240,7 @@ checkbuf(char *rec, int size)
return (rec);
 }
 
-void
+static void
 error(int num)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227260 - head/usr.sbin/snapinfo

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:43 2011
New Revision: 227260
URL: http://svn.freebsd.org/changeset/base/227260

Log:
  Mark global functions and/or variables in snapinfo(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/snapinfo/snapinfo.c

Modified: head/usr.sbin/snapinfo/snapinfo.c
==
--- head/usr.sbin/snapinfo/snapinfo.c   Sun Nov  6 19:02:37 2011
(r227259)
+++ head/usr.sbin/snapinfo/snapinfo.c   Sun Nov  6 19:02:43 2011
(r227260)
@@ -39,14 +39,15 @@
 #include 
 #include 
 
-void   find_inum(char *path);
-void   usage(void);
-intcompare_function(const char *, const struct stat *, int, struct FTW *);
-intfind_snapshot(struct statfs *sfs);
-
-int verbose;
-int cont_search;
-uint32_t inode;
+static voidfind_inum(char *path);
+static voidusage(void);
+static int compare_function(const char *, const struct stat *,
+   int, struct FTW *);
+static int find_snapshot(struct statfs *sfs);
+
+static int verbose;
+static int cont_search;
+static uint32_tinode;
 
 int
 main(int argc, char **argv)
@@ -112,7 +113,7 @@ main(int argc, char **argv)
return (0);
 }
 
-int
+static int
 find_snapshot(struct statfs *sfs)
 {
struct uufsd disk;
@@ -138,7 +139,7 @@ find_snapshot(struct statfs *sfs)
return 0;
 }
 
-int
+static int
 compare_function(const char *path, const struct stat *st, int flags,
 struct FTW * ftwv __unused)
 {
@@ -157,7 +158,7 @@ compare_function(const char *path, const
return (0);
 }
 
-void
+static void
 find_inum(char *path)
 {
int ret;
@@ -169,7 +170,7 @@ find_inum(char *path)
}
 }
 
-void
+static void
 usage(void)
 {
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227261 - head/usr.sbin/spray

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 19:02:49 2011
New Revision: 227261
URL: http://svn.freebsd.org/changeset/base/227261

Log:
  Mark global functions and/or variables in spray(8) static where possible.
  
  This allows compilers and static analyzers to do more thorough analysis.

Modified:
  head/usr.sbin/spray/spray.c

Modified: head/usr.sbin/spray/spray.c
==
--- head/usr.sbin/spray/spray.c Sun Nov  6 19:02:43 2011(r227260)
+++ head/usr.sbin/spray/spray.c Sun Nov  6 19:02:49 2011(r227261)
@@ -49,12 +49,12 @@ static void usage(void);
 static void print_xferstats(unsigned int, int, double);
 
 /* spray buffer */
-char spray_buffer[SPRAYMAX];
+static char spray_buffer[SPRAYMAX];
 
 /* RPC timeouts */
-struct timeval NO_DEFAULT = { -1, -1 };
-struct timeval ONE_WAY = { 0, 0 };
-struct timeval TIMEOUT = { 25, 0 };
+static struct timeval NO_DEFAULT = { -1, -1 };
+static struct timeval ONE_WAY = { 0, 0 };
+static struct timeval TIMEOUT = { 25, 0 };
 
 int
 main(int argc, char *argv[])
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227262 - head/sbin/bsdlabel

2011-11-06 Thread Andrey V. Elsukov
Author: ae
Date: Sun Nov  6 19:03:07 2011
New Revision: 227262
URL: http://svn.freebsd.org/changeset/base/227262

Log:
  Remove unneeded checks.
  
  MFC after:1 week

Modified:
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==
--- head/sbin/bsdlabel/bsdlabel.c   Sun Nov  6 19:02:49 2011
(r227261)
+++ head/sbin/bsdlabel/bsdlabel.c   Sun Nov  6 19:03:07 2011
(r227262)
@@ -831,7 +831,7 @@ getasciilabel(FILE *f, struct disklabel 
continue;
}
if (sscanf(cp, "%lu partitions", &v) == 1) {
-   if (v == 0 || v > MAXPARTITIONS) {
+   if (v > MAXPARTITIONS) {
fprintf(stderr,
"line %d: bad # of partitions\n", lineno);
lp->d_npartitions = MAXPARTITIONS;
@@ -1186,8 +1186,7 @@ checklabel(struct disklabel *lp)
lp->d_secperunit = vl->d_secperunit;
if (lp->d_bbsize == 0)
lp->d_bbsize = vl->d_bbsize;
-   if (lp->d_npartitions == 0 ||
-   lp->d_npartitions < DEFPARTITIONS ||
+   if (lp->d_npartitions < DEFPARTITIONS ||
lp->d_npartitions > MAXPARTITIONS)
lp->d_npartitions = vl->d_npartitions;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227266 - head/sys/netinet

2011-11-06 Thread Michael Tuexen
Author: tuexen
Date: Sun Nov  6 20:09:22 2011
New Revision: 227266
URL: http://svn.freebsd.org/changeset/base/227266

Log:
  Initialize all components of the sent COOKIE.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sun Nov  6 19:57:17 2011
(r227265)
+++ head/sys/netinet/sctp_output.c  Sun Nov  6 20:09:22 2011
(r227266)
@@ -5711,6 +5711,8 @@ do_a_abort:
stc.laddress[2] = 0;
stc.laddress[3] = 0;
stc.laddr_type = SCTP_IPV4_ADDRESS;
+   /* scope_id is only for v6 */
+   stc.scope_id = 0;
break;
 #endif
 #ifdef INET6
@@ -5719,6 +5721,7 @@ do_a_abort:
memcpy(&stc.address, &sin6->sin6_addr,
sizeof(struct in6_addr));
stc.addr_type = SCTP_IPV6_ADDRESS;
+   stc.scope_id = sin6->sin6_scope_id;
if (net->src_addr_selected == 0) {
/*
 * strange case here, the INIT should have
@@ -5746,6 +5749,7 @@ do_a_abort:
/* who are we */
memcpy(stc.identification, SCTP_VERSION_STRING,
min(strlen(SCTP_VERSION_STRING), sizeof(stc.identification)));
+   memset(stc.reserved, 0, SCTP_RESERVE_SPACE);
/* now the chunk header */
initack->ch.chunk_type = SCTP_INITIATION_ACK;
initack->ch.chunk_flags = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227267 - in head/sys: dev/iscsi/initiator fs/nwfs fs/smbfs sys ufs/ufs

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 20:16:50 2011
New Revision: 227267
URL: http://svn.freebsd.org/changeset/base/227267

Log:
  Remove MALLOC_DECLAREs of nonexisting malloc-pools.
  
  After careful grepping, it seems none of these pools can be found in our
  source tree. They are not in use, nor are they defined.

Modified:
  head/sys/dev/iscsi/initiator/iscsivar.h
  head/sys/fs/nwfs/nwfs_mount.h
  head/sys/fs/smbfs/smbfs.h
  head/sys/sys/event.h
  head/sys/sys/file.h
  head/sys/ufs/ufs/extattr.h

Modified: head/sys/dev/iscsi/initiator/iscsivar.h
==
--- head/sys/dev/iscsi/initiator/iscsivar.h Sun Nov  6 20:09:22 2011
(r227266)
+++ head/sys/dev/iscsi/initiator/iscsivar.h Sun Nov  6 20:16:50 2011
(r227267)
@@ -64,7 +64,6 @@ typedef uint32_t digest_t(const void *, 
 
 MALLOC_DECLARE(M_ISCSI);
 MALLOC_DECLARE(M_ISCSIBUF);
-MALLOC_DECLARE(M_PDU);
 
 #define ISOK2DIG(dig, pp)  ((dig != NULL) && ((pp->ipdu.bhs.opcode & 0x1f) 
!= ISCSI_LOGIN_CMD))
 

Modified: head/sys/fs/nwfs/nwfs_mount.h
==
--- head/sys/fs/nwfs/nwfs_mount.h   Sun Nov  6 20:09:22 2011
(r227266)
+++ head/sys/fs/nwfs/nwfs_mount.h   Sun Nov  6 20:16:50 2011
(r227267)
@@ -65,11 +65,4 @@ struct nwfs_args {
int tz;
 };
 
-#ifdef _KERNEL
-
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_NWFSMNT);
-#endif
-
-#endif
 #endif /* !_NWFS_MOUNT_H_ */

Modified: head/sys/fs/smbfs/smbfs.h
==
--- head/sys/fs/smbfs/smbfs.h   Sun Nov  6 20:09:22 2011(r227266)
+++ head/sys/fs/smbfs/smbfs.h   Sun Nov  6 20:16:50 2011(r227267)
@@ -61,10 +61,6 @@ struct smbfs_args {
 
 #include 
 
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_SMBFSMNT);
-#endif
-
 struct smbnode;
 struct smb_share;
 struct u_cred;

Modified: head/sys/sys/event.h
==
--- head/sys/sys/event.hSun Nov  6 20:09:22 2011(r227266)
+++ head/sys/sys/event.hSun Nov  6 20:16:50 2011(r227267)
@@ -147,10 +147,6 @@ struct knlist {
 
 #ifdef _KERNEL
 
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_KQUEUE);
-#endif
-
 /*
  * Flags for knote call
  */

Modified: head/sys/sys/file.h
==
--- head/sys/sys/file.h Sun Nov  6 20:09:22 2011(r227266)
+++ head/sys/sys/file.h Sun Nov  6 20:16:50 2011(r227267)
@@ -185,10 +185,6 @@ struct xfile {
 
 #ifdef _KERNEL
 
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_FILE);
-#endif
-
 extern struct fileops vnops;
 extern struct fileops badfileops;
 extern struct fileops socketops;

Modified: head/sys/ufs/ufs/extattr.h
==
--- head/sys/ufs/ufs/extattr.h  Sun Nov  6 20:09:22 2011(r227266)
+++ head/sys/ufs/ufs/extattr.h  Sun Nov  6 20:16:50 2011(r227267)
@@ -115,10 +115,6 @@ struct extattr {
 
 #include 
 
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_EXTATTR);
-#endif
-
 struct vnode;
 LIST_HEAD(ufs_extattr_list_head, ufs_extattr_list_entry);
 struct ufs_extattr_list_entry {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r227269 - head/usr.bin/at

2011-11-06 Thread Ed Schouten
Author: ed
Date: Sun Nov  6 20:30:21 2011
New Revision: 227269
URL: http://svn.freebsd.org/changeset/base/227269

Log:
  Partially revert r227233.
  
  The privs.h header is not only used by at(1), it's also used by
  atrun(8). Just let the code the way it used to be (for now).
  
  Reported by:  kwm, tinderbox
  Hat to:   me

Modified:
  head/usr.bin/at/at.c
  head/usr.bin/at/privs.h

Modified: head/usr.bin/at/at.c
==
--- head/usr.bin/at/at.cSun Nov  6 20:29:18 2011(r227268)
+++ head/usr.bin/at/at.cSun Nov  6 20:30:21 2011(r227269)
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
 #include "panic.h"
 #include "parsetime.h"
 #include "perm.h"
+
+#define MAIN
 #include "privs.h"
 
 /* Macros */
@@ -102,8 +104,6 @@ int fcreated;
 char atfile[] = ATJOB_DIR "12345678901234";
 char atverify = 0; /* verify time instead of queuing job */
 char *namep;
-uid_t real_uid, effective_uid;
-gid_t real_gid, effective_gid;
 
 /* Function declarations */
 

Modified: head/usr.bin/at/privs.h
==
--- head/usr.bin/at/privs.h Sun Nov  6 20:29:18 2011(r227268)
+++ head/usr.bin/at/privs.h Sun Nov  6 20:30:21 2011(r227269)
@@ -59,8 +59,15 @@
  * to the real userid before calling any of them.
  */
 
-extern uid_t real_uid, effective_uid;
-extern gid_t real_gid, effective_gid;
+#ifndef MAIN
+extern
+#endif
+uid_t real_uid, effective_uid;
+
+#ifndef MAIN 
+extern
+#endif
+gid_t real_gid, effective_gid;
 
 #define RELINQUISH_PRIVS { \
real_uid = getuid(); \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


  1   2   >