diff options
-rw-r--r-- | usr.bin/compile_et/error_table.y | 1 | ||||
-rw-r--r-- | usr.bin/compile_et/et_lex.lex.l | 1 | ||||
-rw-r--r-- | usr.bin/locate/code/locate.code.c | 15 | ||||
-rw-r--r-- | usr.bin/locate/locate/locate.c | 22 | ||||
-rw-r--r-- | usr.bin/mail/fio.c | 6 | ||||
-rw-r--r-- | usr.bin/nc/atomicio.c | 2 | ||||
-rw-r--r-- | usr.bin/nc/netcat.c | 3 | ||||
-rw-r--r-- | usr.bin/nc/socks.c | 11 | ||||
-rw-r--r-- | usr.bin/netstat/inet.c | 6 | ||||
-rw-r--r-- | usr.bin/netstat/mroute.c | 4 | ||||
-rw-r--r-- | usr.bin/nfsstat/nfsstat.c | 6 | ||||
-rw-r--r-- | usr.bin/top/machine.c | 18 | ||||
-rw-r--r-- | usr.bin/top/machine.h | 4 | ||||
-rw-r--r-- | usr.bin/top/top.c | 22 | ||||
-rw-r--r-- | usr.bin/top/username.c | 3 | ||||
-rw-r--r-- | usr.bin/top/utils.c | 3 |
16 files changed, 63 insertions, 64 deletions
diff --git a/usr.bin/compile_et/error_table.y b/usr.bin/compile_et/error_table.y index 350af9ad22b..23ee92dd772 100644 --- a/usr.bin/compile_et/error_table.y +++ b/usr.bin/compile_et/error_table.y @@ -45,6 +45,7 @@ long name2number(const char *str); void error_message(char *, ...); extern char *yytext; +int yyparse(void); /* This is for bison */ diff --git a/usr.bin/compile_et/et_lex.lex.l b/usr.bin/compile_et/et_lex.lex.l index b2f0a95d315..9f9e232375a 100644 --- a/usr.bin/compile_et/et_lex.lex.l +++ b/usr.bin/compile_et/et_lex.lex.l @@ -53,6 +53,7 @@ static unsigned lineno = 1; void error_message(char *, ...); int getstring(void); +int yylex(void); %} diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c index 00a989a1788..8f7d9fcf98d 100644 --- a/usr.bin/locate/code/locate.code.c +++ b/usr.bin/locate/code/locate.code.c @@ -1,5 +1,5 @@ /* - * $OpenBSD: locate.code.c,v 1.10 2003/06/03 02:56:10 millert Exp $ + * $OpenBSD: locate.code.c,v 1.11 2003/07/07 21:36:16 deraadt Exp $ * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: locate.code.c,v 1.10 2003/06/03 02:56:10 millert Exp $ + * $Id: locate.code.c,v 1.11 2003/07/07 21:36:16 deraadt Exp $ */ #ifndef lint @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)locate.code.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: locate.code.c,v 1.10 2003/06/03 02:56:10 millert Exp $"; +static char rcsid[] = "$OpenBSD: locate.code.c,v 1.11 2003/07/07 21:36:16 deraadt Exp $"; #endif #endif /* not lint */ @@ -124,9 +124,7 @@ extern int optind; extern int optopt; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { u_char *cp, *oldpath, *path; int ch, code, count, diffcount, oldcount; @@ -251,8 +249,7 @@ main(argc, argv) #ifndef LOOKUP int -bgindex(bg) /* Return location of bg in bigrams or -1. */ - char *bg; +bgindex(char *bg) /* Return location of bg in bigrams or -1. */ { char bg0, bg1, *p; @@ -266,7 +263,7 @@ bgindex(bg) /* Return location of bg in bigrams or -1. */ #endif /* !LOOKUP */ void -usage() +usage(void) { (void)fprintf(stderr, "usage: locate.code common_bigrams < list > squozen_list\n"); diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index e0864df335b..5f0361c1838 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -1,5 +1,5 @@ /* - * $OpenBSD: locate.c,v 1.15 2003/06/03 02:56:10 millert Exp $ + * $OpenBSD: locate.c,v 1.16 2003/07/07 21:36:16 deraadt Exp $ * * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. * Copyright (c) 1989, 1993 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: locate.c,v 1.15 2003/06/03 02:56:10 millert Exp $ + * $Id: locate.c,v 1.16 2003/07/07 21:36:16 deraadt Exp $ */ #ifndef lint @@ -46,7 +46,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)locate.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: locate.c,v 1.15 2003/06/03 02:56:10 millert Exp $"; +static char rcsid[] = "$OpenBSD: locate.c,v 1.16 2003/07/07 21:36:16 deraadt Exp $"; #endif #endif /* not lint */ @@ -142,9 +142,7 @@ extern int optind; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int ch; char **dbv = NULL; @@ -230,9 +228,7 @@ main(argc, argv) void -search_fopen(db, s) - char *db; /* database */ - char **s; /* search strings */ +search_fopen(char *db, char **s) { FILE *fp; #ifdef DEBUG @@ -282,9 +278,7 @@ search_fopen(db, s) #ifdef MMAP void -search_mmap(db, s) - char *db; /* database */ - char **s; /* search strings */ +search_mmap(char *db, char **s) { struct stat sb; int fd; @@ -327,7 +321,7 @@ search_mmap(db, s) #ifdef DEBUG unsigned long -cputime () +cputime(void) { struct rusage rus; @@ -337,7 +331,7 @@ cputime () #endif /* DEBUG */ void -usage () +usage(void) { (void)fprintf(stderr, "usage: locate [-Scims] [-l limit] "); (void)fprintf(stderr, "[-d database] pattern ...\n"); diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index 4f359276248..3f4acf57531 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fio.c,v 1.23 2003/06/03 02:56:11 millert Exp $ */ +/* $OpenBSD: fio.c,v 1.24 2003/07/07 21:36:51 deraadt Exp $ */ /* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static const char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95"; #else -static const char rcsid[] = "$OpenBSD: fio.c,v 1.23 2003/06/03 02:56:11 millert Exp $"; +static const char rcsid[] = "$OpenBSD: fio.c,v 1.24 2003/07/07 21:36:51 deraadt Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static volatile sig_atomic_t fiosignal; /* * Wrapper for read() to catch EINTR. */ -ssize_t +static ssize_t myread(int fd, char *buf, int len) { ssize_t nread; diff --git a/usr.bin/nc/atomicio.c b/usr.bin/nc/atomicio.c index 02289f0a2a4..4437b6717bb 100644 --- a/usr.bin/nc/atomicio.c +++ b/usr.bin/nc/atomicio.c @@ -29,6 +29,8 @@ #include <errno.h> #include <unistd.h> +ssize_t atomicio(ssize_t (*f)(int, void *, size_t), int fd, void *_s, size_t n); + /* * ensure all of data on socket comes through. f==read || f==write */ diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index 8e02196c3aa..41de61fb339 100644 --- a/usr.bin/nc/netcat.c +++ b/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.60 2003/07/07 14:12:18 avsm Exp $ */ +/* $OpenBSD: netcat.c,v 1.61 2003/07/07 21:36:23 deraadt Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * @@ -220,7 +220,6 @@ main(int argc, char *argv[]) hints.ai_flags |= AI_NUMERICHOST; } - if (xflag) { if (uflag) errx(1, "no proxy support for UDP mode"); diff --git a/usr.bin/nc/socks.c b/usr.bin/nc/socks.c index 25779d2e992..a6b4fdd7e33 100644 --- a/usr.bin/nc/socks.c +++ b/usr.bin/nc/socks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.7 2003/06/03 20:49:29 deraadt Exp $ */ +/* $OpenBSD: socks.c,v 1.8 2003/07/07 21:36:23 deraadt Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -46,9 +46,12 @@ #define SOCKS_MAXCMDSZ 10 int remote_connect(char *, char *, struct addrinfo); +int socks_connect(char *host, char *port, struct addrinfo hints, + char *proxyhost, char *proxyport, struct addrinfo proxyhints, + int socksv); static in_addr_t -decode_addr (const char *s) +decode_addr(const char *s) { struct hostent *hp = gethostbyname (s); struct in_addr retval; @@ -61,7 +64,7 @@ decode_addr (const char *s) } static in_port_t -decode_port (const char *s) +decode_port(const char *s) { struct servent *sp; in_port_t port; @@ -79,7 +82,7 @@ decode_port (const char *s) } int -socks_connect (char *host, char *port, struct addrinfo hints, +socks_connect(char *host, char *port, struct addrinfo hints, char *proxyhost, char *proxyport, struct addrinfo proxyhints, int socksv) { diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 22e15747f00..ac979285e87 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.c,v 1.65 2003/06/03 02:56:13 millert Exp $ */ +/* $OpenBSD: inet.c,v 1.66 2003/07/07 21:36:52 deraadt Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -static char *rcsid = "$OpenBSD: inet.c,v 1.65 2003/06/03 02:56:13 millert Exp $"; +static char *rcsid = "$OpenBSD: inet.c,v 1.66 2003/07/07 21:36:52 deraadt Exp $"; #endif #endif /* not lint */ @@ -521,7 +521,7 @@ struct rpcnams { char *rpcname; }; -char * +static char * getrpcportnam(in_port_t port, int proto) { struct sockaddr_in server_addr; diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c index 2d1808cbfad..5eb607fa658 100644 --- a/usr.bin/netstat/mroute.c +++ b/usr.bin/netstat/mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mroute.c,v 1.10 2003/06/03 02:56:13 millert Exp $ */ +/* $OpenBSD: mroute.c,v 1.11 2003/07/07 21:36:52 deraadt Exp $ */ /* $NetBSD: mroute.c,v 1.10 1996/05/11 13:51:27 mycroft Exp $ */ /* @@ -60,7 +60,7 @@ #include <stdlib.h> #include "netstat.h" -char * +static char * pktscale(u_long n) { static char buf[8]; diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index a3e076d902c..24de2bfc461 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfsstat.c,v 1.20 2003/06/26 21:59:10 deraadt Exp $ */ +/* $OpenBSD: nfsstat.c,v 1.21 2003/07/07 21:36:52 deraadt Exp $ */ /* $NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = static char sccsid[] = "from: @(#)nfsstat.c 8.1 (Berkeley) 6/6/93"; static char *rcsid = "$NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $"; #else -static char *rcsid = "$OpenBSD: nfsstat.c,v 1.20 2003/06/26 21:59:10 deraadt Exp $"; +static char *rcsid = "$OpenBSD: nfsstat.c,v 1.21 2003/07/07 21:36:52 deraadt Exp $"; #endif #endif /* not lint */ @@ -86,6 +86,7 @@ void printhdr(void); void intpr(u_int); void sidewaysintpr(u_int, u_int); void usage(void); +void catchalarm(int); int main(int argc, char *argv[]) @@ -347,7 +348,6 @@ sidewaysintpr(u_int interval, u_int display) struct nfsstats nfsstats, lastst; int hdrcnt; sigset_t emptyset; - void catchalarm(int); (void)signal(SIGALRM, catchalarm); signalled = 0; diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index fdcd85ee70a..f0825c9291d 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.c,v 1.35 2003/06/18 08:36:31 deraadt Exp $ */ +/* $OpenBSD: machine.c,v 1.36 2003/07/07 21:36:52 deraadt Exp $ */ /*- * Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com> @@ -146,7 +146,7 @@ static int pageshift; /* log base 2 of the pagesize */ unsigned int maxslp; -int +static int getstathz(void) { struct clockinfo cinf; @@ -260,7 +260,7 @@ get_system_info(struct system_info *si) static struct handle handle; -struct kinfo_proc * +static struct kinfo_proc * getprocs(int op, int arg, int *cnt) { size_t size = sizeof(int); @@ -374,7 +374,7 @@ get_process_info(struct system_info *si, struct process_select *sel, char fmt[MAX_COLS]; /* static area where result is built */ char * -format_next_process(caddr_t handle, char *(*get_userid)()) +format_next_process(caddr_t handle, char *(*get_userid)(uid_t)) { char *p_wait, waddr[sizeof(void *) * 2 + 3]; /* Hexify void pointer */ struct kinfo_proc *pp; @@ -470,7 +470,7 @@ static unsigned char sorted_state[] = if ((result = PROCSIZE(p2) - PROCSIZE(p1)) == 0) /* compare_cpu - the comparison function for sorting by cpu percentage */ -int +static int compare_cpu(const void *v1, const void *v2) { struct proc **pp1 = (struct proc **) v1; @@ -494,7 +494,7 @@ compare_cpu(const void *v1, const void *v2) } /* compare_size - the comparison function for sorting by total memory usage */ -int +static int compare_size(const void *v1, const void *v2) { struct proc **pp1 = (struct proc **) v1; @@ -518,7 +518,7 @@ compare_size(const void *v1, const void *v2) } /* compare_res - the comparison function for sorting by resident set size */ -int +static int compare_res(const void *v1, const void *v2) { struct proc **pp1 = (struct proc **) v1; @@ -542,7 +542,7 @@ compare_res(const void *v1, const void *v2) } /* compare_time - the comparison function for sorting by CPU time */ -int +static int compare_time(const void *v1, const void *v2) { struct proc **pp1 = (struct proc **) v1; @@ -566,7 +566,7 @@ compare_time(const void *v1, const void *v2) } /* compare_prio - the comparison function for sorting by CPU time */ -int +static int compare_prio(const void *v1, const void *v2) { struct proc **pp1 = (struct proc **) v1; diff --git a/usr.bin/top/machine.h b/usr.bin/top/machine.h index 040c761604f..f360d89471f 100644 --- a/usr.bin/top/machine.h +++ b/usr.bin/top/machine.h @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.h,v 1.8 2003/06/15 16:24:44 millert Exp $ */ +/* $OpenBSD: machine.h,v 1.9 2003/07/07 21:36:52 deraadt Exp $ */ /* * Top users/processes display for Unix @@ -86,6 +86,6 @@ extern void get_system_info(struct system_info *); extern caddr_t get_process_info(struct system_info *, struct process_select *, int (*) (const void *, const void *)); -extern char *format_next_process(caddr_t, char *(*) ()); +extern char *format_next_process(caddr_t, char *(*)(uid_t)); extern int proc_compate(const void *, const void *); extern uid_t proc_owner(pid_t); diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 9472a5567bd..3d70b81f873 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.26 2003/06/19 22:40:45 millert Exp $ */ +/* $OpenBSD: top.c,v 1.27 2003/07/07 21:36:52 deraadt Exp $ */ /* * Top users/processes display for Unix @@ -75,13 +75,13 @@ extern int (*proc_compares[])(const void *, const void *); int order_index; /* pointers to display routines */ -void (*d_loadave) () = i_loadave; -void (*d_procstates) () = i_procstates; -void (*d_cpustates) () = i_cpustates; -void (*d_memory) () = i_memory; -void (*d_message) () = i_message; -void (*d_header) () = i_header; -void (*d_process) () = i_process; +void (*d_loadave) (int, double *) = i_loadave; +void (*d_procstates) (int, int *) = i_procstates; +void (*d_cpustates) (int *) = i_cpustates; +void (*d_memory) (int *) = i_memory; +void (*d_message) (void) = i_message; +void (*d_header) (char *) = i_header; +void (*d_process) (int, char *) = i_process; int displays = 0; /* indicates unspecified */ char do_unames = Yes; @@ -121,7 +121,7 @@ char topn_specified = No; #define CMD_system 15 #define CMD_order 16 -void +static void usage(void) { extern char *__progname; @@ -131,7 +131,7 @@ usage(void) __progname); } -void +static void parseargs(int ac, char **av) { char *endp; @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) { char *uname_field = "USERNAME", *header_text, *env_top; - char *(*get_userid)() = username, **preset_argv, **av; + char *(*get_userid)(uid_t) = username, **preset_argv, **av; int preset_argc = 0, ac, active_procs, i; sigset_t mask, oldmask; time_t curr_time; diff --git a/usr.bin/top/username.c b/usr.bin/top/username.c index ff99c932e57..2d5cc0f3745 100644 --- a/usr.bin/top/username.c +++ b/usr.bin/top/username.c @@ -1,4 +1,4 @@ -/* $OpenBSD: username.c,v 1.12 2003/06/19 22:40:45 millert Exp $ */ +/* $OpenBSD: username.c,v 1.13 2003/07/07 21:36:52 deraadt Exp $ */ /* * Top users/processes display for Unix @@ -53,6 +53,7 @@ #include <pwd.h> #include "top.local.h" +#include "top.h" #include "utils.h" struct hash_el { diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c index 74be677604e..7a6ec4f2e28 100644 --- a/usr.bin/top/utils.c +++ b/usr.bin/top/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.12 2003/06/20 16:53:15 deraadt Exp $ */ +/* $OpenBSD: utils.c,v 1.13 2003/07/07 21:36:52 deraadt Exp $ */ /* * Top users/processes display for Unix @@ -39,6 +39,7 @@ #include <unistd.h> #include "top.h" +#include "utils.h" int atoiwi(char *str) |