summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2014-05-15 19:18:24 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2014-05-15 19:18:24 +0000
commit85c10add4fa29bc8a1ed16224cd08c02860111d3 (patch)
tree303a61afaea71de131f7b77ecaed9fe508dcadb5
parentcba3bed5eb64142c2a945be867c6196b2a6a6cac (diff)
- typo in comment
- memset() is not needed after a calloc() - add missing DBG_ENTER; - use SEEK_SET instead of 0 in an lseek() call ok krw@
-rw-r--r--sbin/growfs/growfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index e5c9aaf1b13..8b7f9e5946f 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: growfs.c,v 1.35 2014/05/05 15:04:05 krw Exp $ */
+/* $OpenBSD: growfs.c,v 1.36 2014/05/15 19:18:23 chl Exp $ */
/*
* Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz
* Copyright (c) 1980, 1989, 1993 The Regents of the University of California.
@@ -663,7 +663,7 @@ cond_bl_upd(daddr_t *block, struct gfs_bpp *field, int fsi, int fso,
/*
* Copy the block back immediately.
*
- * XXX If src is is from an indirect block we have
+ * XXX If src is from an indirect block we have
* to implement copy on write here in case of
* active snapshots.
*/
@@ -1240,8 +1240,6 @@ updcsloc(time_t utime, int fsi, int fso, unsigned int Nflag)
sizeof(struct gfs_bpp));
if (bp == NULL)
errx(1, "calloc failed");
- memset((char *)bp, 0, ((dupper-odupper) / sblock.fs_frag + 2) *
- sizeof(struct gfs_bpp));
/*
* Lock all new frags needed for the cylinder group summary. This is
@@ -1519,11 +1517,12 @@ rdfs(daddr_t bno, size_t size, void *bf, int fsi)
DBG_FUNC("rdfs")
ssize_t n;
+ DBG_ENTER;
if (bno < 0) {
err(32, "rdfs: attempting to read negative block number");
}
- if (lseek(fsi, (off_t)bno * DEV_BSIZE, 0) < 0) {
+ if (lseek(fsi, (off_t)bno * DEV_BSIZE, SEEK_SET) < 0) {
err(33, "rdfs: seek error: %jd", (intmax_t)bno);
}
n = read(fsi, bf, size);