summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2014-05-13 12:51:40 +0000
committerkrw <krw@openbsd.org>2014-05-13 12:51:40 +0000
commit6783a1e5c4321b7182fbd5db4161dfd0c82d01b1 (patch)
treea3a4130a8437dde3d013e7ae15a5eb8fad714c90
parentskip incomplete entries in /etc/hosts and /etc/networks (diff)
downloadwireguard-openbsd-6783a1e5c4321b7182fbd5db4161dfd0c82d01b1.tar.xz
wireguard-openbsd-6783a1e5c4321b7182fbd5db4161dfd0c82d01b1.zip
Nuke another pointless dev_bsize variable always set to 512 and use
DEV_BSIZE. David Vasek says it still works the same on 4K-byte-sector device. i.e. prints one value incorrectly. For which a fix should be following soon.
-rw-r--r--sbin/dumpfs/dumpfs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c
index 9a9e2c3bc29..7633b89fc23 100644
--- a/sbin/dumpfs/dumpfs.c
+++ b/sbin/dumpfs/dumpfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dumpfs.c,v 1.29 2013/04/02 03:05:37 guenther Exp $ */
+/* $OpenBSD: dumpfs.c,v 1.30 2014/05/13 12:51:40 krw Exp $ */
/*
* Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -66,8 +66,6 @@ union {
} cgun;
#define acg cgun.cg
-long dev_bsize;
-
int dumpfs(int, const char *);
int dumpcg(const char *, int, int);
int marshal(const char *);
@@ -146,7 +144,6 @@ open_disk(const char *name)
return (-1);
}
- dev_bsize = afs.fs_fsize / fsbtodb(&afs, 1);
return (fd);
}
@@ -288,7 +285,7 @@ dumpfs(int fd, const char *name)
size = afs.fs_cssize - i < afs.fs_bsize ?
afs.fs_cssize - i : afs.fs_bsize;
off = (off_t)(fsbtodb(&afs, (afs.fs_csaddr + j *
- afs.fs_frag))) * dev_bsize;
+ afs.fs_frag))) * DEV_BSIZE;
if (pread(fd, (char *)afs.fs_csp + i, size, off) != size)
goto err;
}
@@ -325,7 +322,7 @@ dumpcg(const char *name, int fd, int c)
int i, j;
printf("\ncg %d:\n", c);
- cur = (off_t)fsbtodb(&afs, cgtod(&afs, c)) * dev_bsize;
+ cur = (off_t)fsbtodb(&afs, cgtod(&afs, c)) * DEV_BSIZE;
if (pread(fd, &acg, afs.fs_bsize, cur) != afs.fs_bsize) {
warn("%s: error reading cg", name);
return(1);