summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-07-08 00:29:23 +0000
committeriedowse <iedowse@FreeBSD.org>2002-07-08 00:29:23 +0000
commit40ca2ecbc9f6ce1f972e08a815b371f861c6f3a4 (patch)
tree12211ae730177499e4d487794e91aba516fe3654
parentd67ae5f23f51adbdba955a259dd097c0d690715b (diff)
downloadFreeBSD-src-40ca2ecbc9f6ce1f972e08a815b371f861c6f3a4.zip
FreeBSD-src-40ca2ecbc9f6ce1f972e08a815b371f861c6f3a4.tar.gz
Replace the use of %qd with intmax_t/%jd and fix a number of -Wall
and -Wformat warnings: o Include timeconv.h for the time conversion functions. o Remove unused variables. o Correct a few cases where %d was used when printing longs.
-rw-r--r--sbin/dump/itime.c1
-rw-r--r--sbin/dump/main.c17
-rw-r--r--sbin/dump/tape.c1
-rw-r--r--sbin/dump/traverse.c24
4 files changed, 23 insertions, 20 deletions
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c
index c875013..dd273ea 100644
--- a/sbin/dump/itime.c
+++ b/sbin/dump/itime.c
@@ -52,6 +52,7 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <timeconv.h>
#include "dump.h"
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index 270ea81..b18fc7c 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -59,10 +59,12 @@ static const char rcsid[] =
#include <err.h>
#include <fcntl.h>
#include <fstab.h>
+#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <timeconv.h>
#include <unistd.h>
#include "dump.h"
@@ -102,7 +104,6 @@ main(int argc, char *argv[])
int just_estimate = 0;
ino_t maxino;
char *tmsg;
- time_t t;
spcl.c_date = _time_to_time64(time(NULL));
@@ -359,7 +360,7 @@ main(int argc, char *argv[])
dev_bsize = sblock->fs_fsize / fsbtodb(sblock, 1);
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);
@@ -492,19 +493,19 @@ main(int argc, char *argv[])
for (i = 0; i < ntrec; i++)
writeheader(maxino - 1);
if (pipeout)
- msg("DUMP: %qd tape blocks\n", spcl.c_tapea);
+ msg("DUMP: %jd tape blocks\n", (intmax_t)spcl.c_tapea);
else
- msg("DUMP: %qd tape blocks on %d volume%s\n",
- spcl.c_tapea, spcl.c_volume,
+ msg("DUMP: %jd tape blocks on %d volume%s\n",
+ (intmax_t)spcl.c_tapea, spcl.c_volume,
(spcl.c_volume == 1) ? "" : "s");
/* report dump performance, avoid division through zero */
if (tend_writing - tstart_writing == 0)
msg("finished in less than a second\n");
else
- msg("finished in %d seconds, throughput %qd KBytes/sec\n",
- tend_writing - tstart_writing,
- spcl.c_tapea / (tend_writing - tstart_writing));
+ msg("finished in %d seconds, throughput %jd KBytes/sec\n",
+ tend_writing - tstart_writing, (intmax_t)(spcl.c_tapea /
+ (tend_writing - tstart_writing)));
putdumptime();
trewind();
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index 1665e76..aa65b47 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -781,6 +781,7 @@ doslave(int cmd, int slave_number)
eot_count = 0;
size = 0;
+ wrote = 0;
while (eot_count < 10 && size < writesize) {
#ifdef RDUMP
if (host)
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 5480663..bd01ecb 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -49,11 +49,13 @@ static const char rcsid[] =
#include <protocols/dumprestore.h>
#include <ctype.h>
-#include <stdio.h>
#include <errno.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <timeconv.h>
#include <unistd.h>
-#include <stdlib.h>
#include "dump.h"
@@ -388,8 +390,6 @@ searchdir(
void
dumpino(union dinode *dp, ino_t ino)
{
- struct ufs1_dinode *dp1;
- struct ufs2_dinode *dp2;
int ind_level, cnt;
off_t size;
char buf[TP_BSIZE];
@@ -705,11 +705,11 @@ loop:
goto loop;
}
if (cnt == -1)
- msg("read error from %s: %s: [block %qd]: count=%d\n",
- disk, strerror(errno), blkno, size);
+ msg("read error from %s: %s: [block %jd]: count=%d\n",
+ disk, strerror(errno), (intmax_t)blkno, size);
else
- msg("short read error from %s: [block %qd]: count=%d, got=%d\n",
- disk, blkno, size, cnt);
+ msg("short read error from %s: [block %jd]: count=%d, got=%d\n",
+ disk, (intmax_t)blkno, size, cnt);
if (++breaderrors > BREADEMAX) {
msg("More than %d block read errors from %s\n",
BREADEMAX, disk);
@@ -730,11 +730,11 @@ loop:
((off_t)blkno << dev_bshift))) == dev_bsize)
continue;
if (cnt == -1) {
- msg("read error from %s: %s: [sector %qd]: count=%d\n",
- disk, strerror(errno), blkno, dev_bsize);
+ msg("read error from %s: %s: [sector %jd]: count=%ld\n",
+ disk, strerror(errno), (intmax_t)blkno, dev_bsize);
continue;
}
- msg("short read error from %s: [sector %qd]: count=%d, got=%d\n",
- disk, blkno, dev_bsize, cnt);
+ msg("short read from %s: [sector %jd]: count=%ld, got=%d\n",
+ disk, (intmax_t)blkno, dev_bsize, cnt);
}
}
OpenPOWER on IntegriCloud