Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sbin Pullup sbin string format fixes [is].
details: https://anonhg.NetBSD.org/src/rev/80a3470c4db4
branches: netbsd-1-5
changeset: 489854:80a3470c4db4
user: tv <tv%NetBSD.org@localhost>
date: Wed Oct 18 00:39:41 2000 +0000
description:
Pullup sbin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.
diffstat:
sbin/Makefile.inc | 3 ++-
sbin/atactl/atactl.c | 22 +++++++++++-----------
sbin/ccdconfig/ccdconfig.c | 7 ++++---
sbin/disklabel/disklabel.c | 32 ++++++++++++++++----------------
sbin/dump/dump.h | 8 ++++----
sbin/dump/main.c | 12 ++++++------
sbin/dump/optr.c | 10 +++++-----
sbin/dump/rcache.c | 8 ++++----
sbin/fsck/fsutil.c | 7 ++++---
sbin/fsck_ext2fs/utilities.c | 6 +++---
sbin/fsck_ffs/utilities.c | 6 +++---
sbin/fsck_lfs/utilities.c | 4 ++--
sbin/fsck_msdos/ext.h | 4 ++--
sbin/fsck_msdos/fat.c | 19 ++++++++++---------
sbin/fsdb/fsdb.c | 6 +++---
sbin/mount/mount.c | 6 +++---
sbin/newfs/newfs.c | 8 ++++----
sbin/newfs_lfs/extern.h | 5 +++--
sbin/ping/ping.c | 21 ++++++++++-----------
sbin/raidctl/rf_configure.c | 4 ++--
sbin/restore/extern.h | 8 +++++---
sbin/route/show.c | 13 ++++++-------
sbin/routed/main.c | 7 ++++---
23 files changed, 116 insertions(+), 110 deletions(-)
diffs (truncated from 829 to 300 lines):
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/Makefile.inc
--- a/sbin/Makefile.inc Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/Makefile.inc Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.13 1998/03/02 22:03:11 cgd Exp $
+# $NetBSD: Makefile.inc,v 1.13.10.1 2000/10/18 00:39:41 tv Exp $
# @(#)Makefile.inc 8.1 (Berkeley) 6/8/93
.include <bsd.own.mk> # for LDSTATIC def'n
@@ -6,3 +6,4 @@
WARNS?= 1
BINDIR?= /sbin
LDSTATIC?= -static
+WFORMAT?= 2
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/atactl/atactl.c
--- a/sbin/atactl/atactl.c Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/atactl/atactl.c Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atactl.c,v 1.6 1999/11/01 02:30:58 soren Exp $ */
+/* $NetBSD: atactl.c,v 1.6.6.1 2000/10/18 00:39:42 tv Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
int main __P((int, char *[]));
void usage __P((void));
void ata_command __P((struct atareq *));
-void print_bitinfo __P((const char *, u_int, struct bitinfo *));
+void print_bitinfo __P((const char *, const char *, u_int, struct bitinfo *));
int fd; /* file descriptor for device */
const char *dvname; /* device name */
@@ -259,15 +259,15 @@
*/
void
-print_bitinfo(f, bits, binfo)
- const char *f;
+print_bitinfo(bf, af, bits, binfo)
+ const char *bf, *af;
u_int bits;
struct bitinfo *binfo;
{
for (; binfo->bitmask != NULL; binfo++)
if (bits & binfo->bitmask)
- printf(f, binfo->string);
+ printf("%s%s%s", bf, binfo->string, af);
}
/*
@@ -380,28 +380,28 @@
inqbuf->atap_queuedepth & 0xf);
printf("Device capabilities:\n");
- print_bitinfo("\t%s\n", inqbuf->atap_capabilities1, ata_caps);
+ print_bitinfo("\t", "\n", inqbuf->atap_capabilities1, ata_caps);
if (inqbuf->atap_ata_major != 0 && inqbuf->atap_ata_major != 0xffff) {
printf("Device supports following standards:\n");
- print_bitinfo("%s ", inqbuf->atap_ata_major, ata_vers);
+ print_bitinfo("", " ", inqbuf->atap_ata_major, ata_vers);
printf("\n");
}
if (inqbuf->atap_cmd_set1 != 0 && inqbuf->atap_cmd_set1 != 0xffff &&
inqbuf->atap_cmd_set2 != 0 && inqbuf->atap_cmd_set2 != 0xffff) {
printf("Command set support:\n");
- print_bitinfo("\t%s\n", inqbuf->atap_cmd_set1, ata_cmd_set1);
- print_bitinfo("\t%s\n", inqbuf->atap_cmd_set2, ata_cmd_set2);
+ print_bitinfo("\t", "\n", inqbuf->atap_cmd_set1, ata_cmd_set1);
+ print_bitinfo("\t", "\n", inqbuf->atap_cmd_set2, ata_cmd_set2);
}
if (inqbuf->atap_cmd_def != 0 && inqbuf->atap_cmd_def != 0xffff) {
printf("Command sets/features enabled:\n");
- print_bitinfo("\t%s\n", inqbuf->atap_cmd_set1 &
+ print_bitinfo("\t", "\n", inqbuf->atap_cmd_set1 &
(WDC_CMD1_SRV | WDC_CMD1_RLSE | WDC_CMD1_AHEAD |
WDC_CMD1_CACHE | WDC_CMD1_SEC | WDC_CMD1_SMART),
ata_cmd_set1);
- print_bitinfo("\t%s\n", inqbuf->atap_cmd_set2 &
+ print_bitinfo("\t", "\n", inqbuf->atap_cmd_set2 &
(WDC_CMD2_RMSN | ATA_CMD2_APM), ata_cmd_set2);
}
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/ccdconfig/ccdconfig.c
--- a/sbin/ccdconfig/ccdconfig.c Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/ccdconfig/ccdconfig.c Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ccdconfig.c,v 1.30.2.1 2000/07/27 16:12:34 itojun Exp $ */
+/* $NetBSD: ccdconfig.c,v 1.30.2.2 2000/10/18 00:39:43 tv Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
__COPYRIGHT(
"@(#) Copyright (c) 1996, 1997\
The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: ccdconfig.c,v 1.30.2.1 2000/07/27 16:12:34 itojun Exp $");
+__RCSID("$NetBSD: ccdconfig.c,v 1.30.2.2 2000/10/18 00:39:43 tv Exp $");
#endif
#include <sys/param.h>
@@ -650,7 +650,8 @@
warnx("%s", kvm_geterr(kd));
goto done;
}
- printf((i + 1 < cs->sc_nccdisks) ? "%s " : "%s\n", path);
+ fputs(path, stdout);
+ fputc((i + 1 < cs->sc_nccdisks) ? ' ' : '\n', stdout);
fflush(stdout);
}
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/disklabel/disklabel.c Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disklabel.c,v 1.84.2.2 2000/07/27 16:12:34 itojun Exp $ */
+/* $NetBSD: disklabel.c,v 1.84.2.3 2000/10/18 00:39:43 tv Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -47,7 +47,7 @@
static char sccsid[] = "@(#)disklabel.c 8.4 (Berkeley) 5/4/95";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#else
-__RCSID("$NetBSD: disklabel.c,v 1.84.2.2 2000/07/27 16:12:34 itojun Exp $");
+__RCSID("$NetBSD: disklabel.c,v 1.84.2.3 2000/10/18 00:39:43 tv Exp $");
#endif
#endif /* not lint */
@@ -1889,20 +1889,20 @@
char *name;
char *expn;
} usages[] = {
- { "%s [-rt] [-C] disk",
+ { "[-rt] [-C] disk",
"(to read label)" },
- { "%s -w [-r] [-f disktab] disk type [ packid ]",
+ { "-w [-r] [-f disktab] disk type [ packid ]",
#if NUMBOOT > 0
"(to write label with existing boot program)"
#else
"(to write label)"
#endif
},
- { "%s -e [-r] [-I] [-C] disk",
+ { "-e [-r] [-I] [-C] disk",
"(to edit label)" },
- { "%s -i [-r] disk",
+ { "-i [-r] disk",
"(to create a label interactively)" },
- { "%s -R [-r] disk protofile",
+ { "-R [-r] disk protofile",
#if NUMBOOT > 0
"(to restore label with existing boot program)"
#else
@@ -1911,22 +1911,22 @@
},
#if NUMBOOT > 0
# if NUMBOOT > 1
- { "%s -B [-f disktab] [ -b xxboot [ -s bootxx ] ] disk [ type ]",
+ { "-B [-f disktab] [ -b xxboot [ -s bootxx ] ] disk [ type ]",
"(to install boot program with existing label)" },
- { "%s -w -B [-f disktab] [ -b xxboot [ -s bootxx ] ] disk type [ packid ]",
+ { "-w -B [-f disktab] [ -b xxboot [ -s bootxx ] ] disk type [ packid ]",
"(to write label and boot program)" },
- { "%s -R -B [-f disktab] [ -b xxboot [ -s bootxx ] ] disk protofile [ type ]",
+ { "-R -B [-f disktab] [ -b xxboot [ -s bootxx ] ] disk protofile [ type ]",
"(to restore label and boot program)" },
# else
- { "%s -B [-f disktab] [ -b bootprog ] disk [ type ]",
+ { "-B [-f disktab] [ -b bootprog ] disk [ type ]",
"(to install boot program with existing on-disk label)" },
- { "%s -w -B [-f disktab] [ -b bootprog ] disk type [ packid ]",
+ { "-w -B [-f disktab] [ -b bootprog ] disk type [ packid ]",
"(to write label and install boot program)" },
- { "%s -R -B [-f disktab] [ -b bootprog ] disk protofile [ type ]",
+ { "-R -B [-f disktab] [ -b bootprog ] disk protofile [ type ]",
"(to restore label and install boot program)" },
# endif
#endif
- { "%s [-NW] disk",
+ { "[-NW] disk",
"(to write disable/enable label)" },
{ NULL,
NULL }
@@ -1935,9 +1935,9 @@
for (i = 0; usages[i].name; i++) {
(void) fputs(i ? "or " : "Usage: ", stderr);
- (void) fprintf(stderr, usages[i].name, __progname);
+ (void) fprintf(stderr, "%s %s", __progname, usages[i].name);
(void) fputs("\n\t", stderr);
- (void) fprintf(stderr, usages[i].expn, __progname);
+ (void) fprintf(stderr, "%s %s", __progname, usages[i].expn);
(void) fputs("\n", stderr);
}
exit(1);
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/dump/dump.h
--- a/sbin/dump/dump.h Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/dump/dump.h Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dump.h,v 1.19 1999/10/01 04:35:22 perseant Exp $ */
+/* $NetBSD: dump.h,v 1.19.6.1 2000/10/18 00:39:43 tv Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -160,10 +160,10 @@
/* operator interface functions */
void broadcast __P((char *message));
void lastdump __P((int arg)); /* int should be char */
-void msg __P((const char *fmt, ...));
-void msgtail __P((const char *fmt, ...));
+void msg __P((const char *fmt, ...)) __attribute__((__format__(__printf__,1,2)));
+void msgtail __P((const char *fmt, ...)) __attribute__((__format__(__printf__,1,2)));
int query __P((char *question));
-void quit __P((const char *fmt, ...));
+void quit __P((const char *fmt, ...)) __attribute__((__format__(__printf__,1,2)));
void set_operators __P((void));
time_t do_stats __P((void));
void statussig __P((int));
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/dump/main.c
--- a/sbin/dump/main.c Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/dump/main.c Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.25 1999/10/01 04:35:23 perseant Exp $ */
+/* $NetBSD: main.c,v 1.25.6.1 2000/10/18 00:39:43 tv Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: main.c,v 1.25 1999/10/01 04:35:23 perseant Exp $");
+__RCSID("$NetBSD: main.c,v 1.25.6.1 2000/10/18 00:39:43 tv Exp $");
#endif
#endif /* not lint */
@@ -414,7 +414,7 @@
dev_bshift = ffs(dev_bsize) - 1;
if (dev_bsize != (1 << dev_bshift))
- quit("dev_bsize (%d) is not a power of 2", dev_bsize);
+ quit("dev_bsize (%ld) is not a power of 2", dev_bsize);
tp_bshift = ffs(TP_BSIZE) - 1;
if (TP_BSIZE != (1 << tp_bshift))
quit("TP_BSIZE (%d) is not a power of 2", TP_BSIZE);
@@ -545,9 +545,9 @@
for (i = 0; i < ntrec; i++)
writeheader(maxino - 1);
if (pipeout)
- msg("%ld tape blocks\n",iswap32(spcl.c_tapea));
+ msg("%d tape blocks\n",iswap32(spcl.c_tapea));
else
- msg("%ld tape blocks on %d volume%s\n",
+ msg("%d tape blocks on %d volume%s\n",
iswap32(spcl.c_tapea), iswap32(spcl.c_volume),
(iswap32(spcl.c_volume) == 1) ? "" : "s");
tnow = do_stats();
@@ -555,7 +555,7 @@
msg("Date of this level %c dump: %s", level,
spcl.c_date == 0 ? "the epoch\n" : ctime(&date));
msg("Date this dump completed: %s", ctime(&tnow));
- msg("Average transfer rate: %ld KB/s\n", xferrate / tapeno);
+ msg("Average transfer rate: %d KB/s\n", xferrate / tapeno);
putdumptime();
trewind();
broadcast("DUMP IS DONE!\7\7\n");
diff -r 4253b83f66f8 -r 80a3470c4db4 sbin/dump/optr.c
--- a/sbin/dump/optr.c Wed Oct 18 00:16:28 2000 +0000
+++ b/sbin/dump/optr.c Wed Oct 18 00:39:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: optr.c,v 1.13 1998/04/01 16:15:40 kleink Exp $ */
+/* $NetBSD: optr.c,v 1.13.10.1 2000/10/18 00:39:44 tv Exp $ */
/*-
* Copyright (c) 1980, 1988, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-__RCSID("$NetBSD: optr.c,v 1.13 1998/04/01 16:15:40 kleink Exp $");
+__RCSID("$NetBSD: optr.c,v 1.13.10.1 2000/10/18 00:39:44 tv Exp $");
#endif
#endif /* not lint */
@@ -325,9 +325,9 @@
deltat = tstart_writing - tnow +
(1.0 * (tnow - tstart_writing))
/ blockswritten * tapesize;
- msg("%3.2f%% done, finished in %d:%02d\n",
- (blockswritten * 100.0) / tapesize,
- deltat / 3600, (deltat % 3600) / 60);
+ msg("%3.2f%% done, finished in %ld:%02ld\n",
+ (blockswritten * 100.0) / tapesize,
+ (long)(deltat / 3600), (long)((deltat % 3600) / 60));
}
Home |
Main Index |
Thread Index |
Old Index