summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Valchev <pvalchev@cvs.openbsd.org>2001-07-27 20:34:37 +0000
committerPeter Valchev <pvalchev@cvs.openbsd.org>2001-07-27 20:34:37 +0000
commit078253af8b9273a3cd3303ffa535f76e3260ac17 (patch)
tree5411e5337586aceb81ad2f64e4b31ea0f65e0c53
parent8303d75019d73ec9a16cd4b93b922fc1d9859743 (diff)
Wall cleanup
-rw-r--r--libexec/lfs_cleanerd/cleanerd.c8
-rw-r--r--libexec/lfs_cleanerd/library.c8
-rw-r--r--libexec/lfs_cleanerd/print.c6
-rw-r--r--usr.sbin/memconfig/memconfig.c3
-rw-r--r--usr.sbin/mrouted/prune.c1
-rw-r--r--usr.sbin/mtrace/mtrace.c40
-rw-r--r--usr.sbin/portmap/portmap.c6
-rw-r--r--usr.sbin/quotaon/quotaon.c3
-rw-r--r--usr.sbin/rpc.bootparamd/bootparamd.c5
-rw-r--r--usr.sbin/rpc.pcnfsd/pcnfsd_print.c2
-rw-r--r--usr.sbin/sa/main.c4
-rw-r--r--usr.sbin/sa/usrdb.c5
-rw-r--r--usr.sbin/sliplogin/sliplogin.c4
-rw-r--r--usr.sbin/syslogd/syslogd.c7
-rw-r--r--usr.sbin/wsconscfg/wsconscfg.c3
-rw-r--r--usr.sbin/ypbind/ypbind.c5
16 files changed, 49 insertions, 61 deletions
diff --git a/libexec/lfs_cleanerd/cleanerd.c b/libexec/lfs_cleanerd/cleanerd.c
index 094ce86f0cd..8b0db6d4e3f 100644
--- a/libexec/lfs_cleanerd/cleanerd.c
+++ b/libexec/lfs_cleanerd/cleanerd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cleanerd.c,v 1.5 1997/08/05 23:42:54 angelos Exp $ */
+/* $OpenBSD: cleanerd.c,v 1.6 2001/07/27 20:34:36 pvalchev Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "@(#)cleanerd.c 8.5 (Berkeley) 6/10/95";*/
-static char rcsid[] = "$OpenBSD: cleanerd.c,v 1.5 1997/08/05 23:42:54 angelos Exp $";
+static char rcsid[] = "$OpenBSD: cleanerd.c,v 1.6 2001/07/27 20:34:36 pvalchev Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -162,7 +162,7 @@ main(argc, argv)
struct timeval timeout; /* sleep timeout */
fsid_t fsid;
long clean_opts; /* cleaning options */
- int i, nodaemon, segs_per_clean;
+ int nodaemon, segs_per_clean;
int opt, cmd_err;
char *fs_name; /* name of filesystem to clean */
extern int optind;
@@ -278,7 +278,7 @@ clean_loop(fsp, nsegs, options)
(fsp->fi_cip->clean < max_free_segs &&
(fsp->fi_cip->clean <= MIN_SEGS(&fsp->fi_lfs) ||
fsp->fi_cip->clean < max_free_segs * BUSY_LIM))) {
- printf("Cleaner Running at %s (%d of %d segments available)\n",
+ printf("Cleaner Running at %s (%d of %lu segments available)\n",
ctime(&now), fsp->fi_cip->clean, max_free_segs);
clean_fs(fsp, cost_benefit, nsegs, options);
return (1);
diff --git a/libexec/lfs_cleanerd/library.c b/libexec/lfs_cleanerd/library.c
index 5ea628761c1..cdf0bfeaa1f 100644
--- a/libexec/lfs_cleanerd/library.c
+++ b/libexec/lfs_cleanerd/library.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library.c,v 1.3 1997/07/23 20:36:30 kstailey Exp $ */
+/* $OpenBSD: library.c,v 1.4 2001/07/27 20:34:36 pvalchev Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)library.c 8.3 (Berkeley) 5/24/95";*/
-static char rcsid[] = "$OpenBSD: library.c,v 1.3 1997/07/23 20:36:30 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: library.c,v 1.4 2001/07/27 20:34:36 pvalchev Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -110,7 +110,6 @@ get_fs_info (lstatfsp, use_mmap)
int use_mmap; /* IN: mmap or read */
{
FS_INFO *fsp;
- int i;
fsp = (FS_INFO *)malloc(sizeof(FS_INFO));
if (fsp == NULL)
@@ -136,8 +135,6 @@ reread_fs_info(fsp, use_mmap)
FS_INFO *fsp; /* IN: prointer fs_infos to reread */
int use_mmap;
{
- int i;
-
if (statfs(fsp->fi_statfsp->f_mntonname, fsp->fi_statfsp))
err(1, "reread_fs_info: statfs failed");
get_ifile (fsp, use_mmap);
@@ -376,7 +373,6 @@ add_blocks (fsp, bip, countp, sp, seg_buf, segaddr, psegaddr)
int db_per_block, i, j;
int db_frag;
u_long page_size;
-long *lp;
#ifdef VERBOSE
printf("FILE INFOS\n");
diff --git a/libexec/lfs_cleanerd/print.c b/libexec/lfs_cleanerd/print.c
index 9aacedef429..86b491cc5ec 100644
--- a/libexec/lfs_cleanerd/print.c
+++ b/libexec/lfs_cleanerd/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.2 1996/07/01 11:04:58 downsj Exp $ */
+/* $OpenBSD: print.c,v 1.3 2001/07/27 20:34:36 pvalchev Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)print.c 8.2 (Berkeley) 5/24/95";*/
-static char rcsid[] = "$OpenBSD: print.c,v 1.2 1996/07/01 11:04:58 downsj Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.3 2001/07/27 20:34:36 pvalchev Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -101,7 +101,7 @@ dump_summary(lfsp, sp, flags, iaddrp)
dp = (daddr_t *)((caddr_t)sp + LFS_SUMMARY_SIZE);
for (--dp, i = 0; i < sp->ss_ninos; --dp)
if (flags & DUMP_INODE_ADDRS) {
- (void)printf("\t0x%lx", *dp);
+ (void)printf("\t0x%x", *dp);
if (++i % 7 == 0)
(void)printf("\n");
} else
diff --git a/usr.sbin/memconfig/memconfig.c b/usr.sbin/memconfig/memconfig.c
index 0409c71b525..b4aa5e0ecb9 100644
--- a/usr.sbin/memconfig/memconfig.c
+++ b/usr.sbin/memconfig/memconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memconfig.c,v 1.2 1999/12/05 06:32:56 deraadt Exp $ */
+/* $OpenBSD: memconfig.c,v 1.3 2001/07/27 20:34:36 pvalchev Exp $ */
/*-
* Copyright (c) 1999 Michael Smith <msmith@freebsd.org>
* All rights reserved.
@@ -157,7 +157,6 @@ listfunc(memfd, argc, argv)
{
struct mem_range_desc *mrd;
int nd, i, j;
- int error;
int ch;
int showall = 0;
char *owner;
diff --git a/usr.sbin/mrouted/prune.c b/usr.sbin/mrouted/prune.c
index 3d28974707d..c62a1dc675a 100644
--- a/usr.sbin/mrouted/prune.c
+++ b/usr.sbin/mrouted/prune.c
@@ -1944,7 +1944,6 @@ dump_cache(fp2)
register struct rtentry *r;
register struct gtable *gt;
register struct stable *st;
- register struct ptable *pt;
register vifi_t i;
register time_t thyme = time(0);
diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c
index aecfa41f75f..372b77339da 100644
--- a/usr.sbin/mtrace/mtrace.c
+++ b/usr.sbin/mtrace/mtrace.c
@@ -52,7 +52,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Id: mtrace.c,v 1.6 2001/06/25 08:42:44 deraadt Exp $";
+ "@(#) $Id: mtrace.c,v 1.7 2001/07/27 20:34:36 pvalchev Exp $";
#endif
#include <netdb.h>
@@ -956,15 +956,15 @@ stat_line(r, s, have_next, rst)
}
if (debug > 2) {
- printf("\t\t\t\tv_in: %ld ", ntohl(s->tr_vifin));
- printf("v_out: %ld ", ntohl(s->tr_vifout));
- printf("pkts: %ld\n", ntohl(s->tr_pktcnt));
- printf("\t\t\t\tv_in: %ld ", ntohl(r->tr_vifin));
- printf("v_out: %ld ", ntohl(r->tr_vifout));
- printf("pkts: %ld\n", ntohl(r->tr_pktcnt));
- printf("\t\t\t\tv_in: %ld ",ntohl(s->tr_vifin)-ntohl(r->tr_vifin));
- printf("v_out: %ld ", ntohl(s->tr_vifout) - ntohl(r->tr_vifout));
- printf("pkts: %ld ", ntohl(s->tr_pktcnt) - ntohl(r->tr_pktcnt));
+ printf("\t\t\t\tv_in: %u ", ntohl(s->tr_vifin));
+ printf("v_out: %u ", ntohl(s->tr_vifout));
+ printf("pkts: %u\n", ntohl(s->tr_pktcnt));
+ printf("\t\t\t\tv_in: %u ", ntohl(r->tr_vifin));
+ printf("v_out: %u ", ntohl(r->tr_vifout));
+ printf("pkts: %u\n", ntohl(r->tr_pktcnt));
+ printf("\t\t\t\tv_in: %u ", ntohl(s->tr_vifin)-ntohl(r->tr_vifin));
+ printf("v_out: %u ", ntohl(s->tr_vifout) - ntohl(r->tr_vifout));
+ printf("pkts: %u ", ntohl(s->tr_pktcnt) - ntohl(r->tr_pktcnt));
printf("time: %d\n", timediff);
printf("\t\t\t\tres: %d\n", res);
}
@@ -1027,7 +1027,7 @@ fixup_stats(base, prev, new)
* doubt from now on.
*/
p->tr_pktcnt = b->tr_pktcnt = n->tr_pktcnt;
- *r++;
+ r++;
} else {
/*
* This is simply the situation that the original
@@ -1088,15 +1088,15 @@ print_stats(base, prev, new)
printf(" --------------------- --------------------\n");
}
if (debug > 2) {
- printf("\t\t\t\tv_in: %ld ", ntohl(n->tr_vifin));
- printf("v_out: %ld ", ntohl(n->tr_vifout));
- printf("pkts: %ld\n", ntohl(n->tr_pktcnt));
- printf("\t\t\t\tv_in: %ld ", ntohl(b->tr_vifin));
- printf("v_out: %ld ", ntohl(b->tr_vifout));
- printf("pkts: %ld\n", ntohl(b->tr_pktcnt));
- printf("\t\t\t\tv_in: %ld ", ntohl(n->tr_vifin) - ntohl(b->tr_vifin));
- printf("v_out: %ld ", ntohl(n->tr_vifout) - ntohl(b->tr_vifout));
- printf("pkts: %ld\n", ntohl(n->tr_pktcnt) - ntohl(b->tr_pktcnt));
+ printf("\t\t\t\tv_in: %u ", ntohl(n->tr_vifin));
+ printf("v_out: %u ", ntohl(n->tr_vifout));
+ printf("pkts: %u\n", ntohl(n->tr_pktcnt));
+ printf("\t\t\t\tv_in: %u ", ntohl(b->tr_vifin));
+ printf("v_out: %u ", ntohl(b->tr_vifout));
+ printf("pkts: %u\n", ntohl(b->tr_pktcnt));
+ printf("\t\t\t\tv_in: %u ", ntohl(n->tr_vifin) - ntohl(b->tr_vifin));
+ printf("v_out: %u ", ntohl(n->tr_vifout) - ntohl(b->tr_vifout));
+ printf("pkts: %u\n", ntohl(n->tr_pktcnt) - ntohl(b->tr_pktcnt));
printf("\t\t\t\treset: %d\n", *r);
}
diff --git a/usr.sbin/portmap/portmap.c b/usr.sbin/portmap/portmap.c
index e01b03d4ac7..def3ae3da88 100644
--- a/usr.sbin/portmap/portmap.c
+++ b/usr.sbin/portmap/portmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: portmap.c,v 1.18 2000/07/31 17:28:26 deraadt Exp $ */
+/* $OpenBSD: portmap.c,v 1.19 2001/07/27 20:34:36 pvalchev Exp $ */
/*-
* Copyright (c) 1996, 1997 Theo de Raadt (OpenBSD). All rights reserved.
@@ -44,7 +44,7 @@ char copyright[] =
#if 0
static char sccsid[] = "from: @(#)portmap.c 5.4 (Berkeley) 4/19/91";
#else
-static char rcsid[] = "$OpenBSD: portmap.c,v 1.18 2000/07/31 17:28:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: portmap.c,v 1.19 2001/07/27 20:34:36 pvalchev Exp $";
#endif
#endif /* not lint */
@@ -332,7 +332,7 @@ reg_service(rqstp, xprt)
}
if (debugging)
- printf("set: prog %u vers %u port %u\n",
+ printf("set: prog %lu vers %lu port %lu\n",
reg.pm_prog, reg.pm_vers, reg.pm_port);
if (reg.pm_port & ~0xffff)
diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c
index 8e77faefeb6..c45f140d979 100644
--- a/usr.sbin/quotaon/quotaon.c
+++ b/usr.sbin/quotaon/quotaon.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quotaon.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: quotaon.c,v 1.10 1997/06/22 06:09:02 deraadt Exp $";
+static char *rcsid = "$Id: quotaon.c,v 1.11 2001/07/27 20:34:36 pvalchev Exp $";
#endif /* not lint */
/*
@@ -72,7 +72,6 @@ main(argc, argv)
char *qfnp, *whoami;
long argnum, done = 0;
int i, offmode = 0, errs = 0;
- extern char *optarg;
extern int optind;
int ch;
diff --git a/usr.sbin/rpc.bootparamd/bootparamd.c b/usr.sbin/rpc.bootparamd/bootparamd.c
index c73167926c3..dee9ee9d1e4 100644
--- a/usr.sbin/rpc.bootparamd/bootparamd.c
+++ b/usr.sbin/rpc.bootparamd/bootparamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootparamd.c,v 1.9 1998/07/10 08:06:50 deraadt Exp $ */
+/* $OpenBSD: bootparamd.c,v 1.10 2001/07/27 20:34:36 pvalchev Exp $ */
/*
* This code is not copyright, and is placed in the public domain.
@@ -64,10 +64,8 @@ main(argc, argv)
char **argv;
{
SVCXPRT *transp;
- int i, s, pid;
struct hostent *he;
struct stat buf;
- char *optstring;
int c;
while ((c = getopt(argc, argv, "dsr:f:")) != -1)
@@ -204,7 +202,6 @@ bootparamproc_getfile_1_svc(getfile, rqstp)
bp_getfile_arg *getfile;
struct svc_req *rqstp;
{
- char *where;
static bp_getfile_res res;
int err;
diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
index 220bf46c362..0382e5d41ba 100644
--- a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
+++ b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
@@ -209,14 +209,12 @@ char *fname;
char *opts;
char **id;
{
-char snum[20];
static char req_id[256];
char cmdbuf[256];
char resbuf[256];
FILE *fd;
int i;
char *xcmd;
-char *cp;
int failed = 0;
#ifdef HACK_FOR_ROTATED_TRANSCRIPT
diff --git a/usr.sbin/sa/main.c b/usr.sbin/sa/main.c
index cad20968ab6..fbbc6610adc 100644
--- a/usr.sbin/sa/main.c
+++ b/usr.sbin/sa/main.c
@@ -33,7 +33,7 @@ static char copright[] =
"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
All rights reserved.\n";
-static char rcsid[] = "$Id: main.c,v 1.5 2000/11/10 15:33:15 provos Exp $";
+static char rcsid[] = "$Id: main.c,v 1.6 2001/07/27 20:34:36 pvalchev Exp $";
#endif
/*
@@ -350,7 +350,7 @@ acct_load(pn, wr)
if (sflag || (mflag && !qflag))
usracct_add(&ci);
} else if (!qflag)
- printf("%6u %12.2lf cpu %12quk mem %12qu io %s\n",
+ printf("%6u %12.2f cpu %12lluk mem %12llu io %s\n",
ci.ci_uid,
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
ci.ci_mem, ci.ci_io, ci.ci_comm);
diff --git a/usr.sbin/sa/usrdb.c b/usr.sbin/sa/usrdb.c
index 656f5eb493a..ee92dfbca55 100644
--- a/usr.sbin/sa/usrdb.c
+++ b/usr.sbin/sa/usrdb.c
@@ -29,7 +29,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$Id: usrdb.c,v 1.2 1999/08/06 20:41:08 deraadt Exp $";
+static char rcsid[] = "$Id: usrdb.c,v 1.3 2001/07/27 20:34:36 pvalchev Exp $";
#endif
#include <sys/types.h>
@@ -172,7 +172,6 @@ usracct_update()
DB *saved_usracct_db;
DBT key, data;
BTREEINFO bti;
- uid_t uid;
int error, serr, nerr;
memset(&bti, 0, sizeof(bti));
@@ -243,7 +242,7 @@ usracct_print()
if (t < 0.0001) /* kill divide by zero */
t = 0.0001;
- printf("%12.2lf%s ", t / 60.0, "cpu");
+ printf("%12.2f%s ", t / 60.0, "cpu");
/* ui->ui_calls is always != 0 */
if (dflag)
diff --git a/usr.sbin/sliplogin/sliplogin.c b/usr.sbin/sliplogin/sliplogin.c
index 1bcfb2d3da9..69af6fbf095 100644
--- a/usr.sbin/sliplogin/sliplogin.c
+++ b/usr.sbin/sliplogin/sliplogin.c
@@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)sliplogin.c 5.6 (Berkeley) 3/2/91";*/
-static char rcsid[] = "$Id: sliplogin.c,v 1.13 2001/06/15 17:43:46 mickey Exp $";
+static char rcsid[] = "$Id: sliplogin.c,v 1.14 2001/07/27 20:34:36 pvalchev Exp $";
#endif /* not lint */
/*
@@ -119,7 +119,7 @@ findid(name)
static char raddr[16];
static char mask[16];
char user[MAXLOGNAME], *p;
- int i, j, n;
+ int n;
strlcpy(loginname, name, sizeof loginname);
if ((fp = fopen(_PATH_ACCESS, "r")) == NULL) {
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index d33ab82924d..38c431870ed 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.40 2001/02/07 06:15:46 fgsch Exp $ */
+/* $OpenBSD: syslogd.c,v 1.41 2001/07/27 20:34:36 pvalchev Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
-static char rcsid[] = "$OpenBSD: syslogd.c,v 1.40 2001/02/07 06:15:46 fgsch Exp $";
+static char rcsid[] = "$OpenBSD: syslogd.c,v 1.41 2001/07/27 20:34:36 pvalchev Exp $";
#endif
#endif /* not lint */
@@ -94,6 +94,7 @@ static char rcsid[] = "$OpenBSD: syslogd.c,v 1.40 2001/02/07 06:15:46 fgsch Exp
#include <ctype.h>
#include <errno.h>
+#include <err.h>
#include <fcntl.h>
#include <paths.h>
#include <setjmp.h>
@@ -722,7 +723,7 @@ fprintlog(f, flags, msg)
case F_FORW:
dprintf(" %s\n", f->f_un.f_forw.f_hname);
l = snprintf(line, sizeof(line) - 1, "<%d>%.15s %s", f->f_prevpri,
- iov[0].iov_base, iov[4].iov_base);
+ (char *)iov[0].iov_base, (char *)iov[4].iov_base);
if (l > MAXLINE)
l = MAXLINE;
if (sendto(finet, line, l, 0,
diff --git a/usr.sbin/wsconscfg/wsconscfg.c b/usr.sbin/wsconscfg/wsconscfg.c
index 611c4109daa..cd23c9b4840 100644
--- a/usr.sbin/wsconscfg/wsconscfg.c
+++ b/usr.sbin/wsconscfg/wsconscfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsconscfg.c,v 1.5 2001/06/25 05:21:07 pvalchev Exp $ */
+/* $OpenBSD: wsconscfg.c,v 1.6 2001/07/27 20:34:36 pvalchev Exp $ */
/* $NetBSD: wsconscfg.c,v 1.4 1999/07/29 18:24:10 augustss Exp $ */
/*
@@ -34,6 +34,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index 8b533ee0fea..5fdd11baa32 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypbind.c,v 1.38 2000/04/11 11:52:55 itojun Exp $ */
+/* $OpenBSD: ypbind.c,v 1.39 2001/07/27 20:34:36 pvalchev Exp $ */
/*
* Copyright (c) 1997,1998 Theo de Raadt <deraadt@OpenBSD.org>
@@ -35,7 +35,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypbind.c,v 1.38 2000/04/11 11:52:55 itojun Exp $";
+static char rcsid[] = "$OpenBSD: ypbind.c,v 1.39 2001/07/27 20:34:36 pvalchev Exp $";
#endif
#include <sys/param.h>
@@ -751,7 +751,6 @@ broadcast(ypdb, buf, outlen)
int outlen;
{
struct ifaddrs *ifap, *ifa;
- int i, sock, len, inlen = 8192;
struct sockaddr_in bindsin;
struct in_addr in;