summaryrefslogtreecommitdiff
path: root/sbin/badsect/badsect.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-08 19:04:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-08-08 19:04:26 +0000
commit889f3d21fbb021429b724ecdb8320c3eb9cde03f (patch)
tree46c1cb70beebf52095a1a30b6750b16f677a4aa0 /sbin/badsect/badsect.c
parent8a0c24c71f1196b735373a9d574c7bfb8c7e2ee8 (diff)
spacing
Diffstat (limited to 'sbin/badsect/badsect.c')
-rw-r--r--sbin/badsect/badsect.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sbin/badsect/badsect.c b/sbin/badsect/badsect.c
index c21a8bedc83..8e6a55cf434 100644
--- a/sbin/badsect/badsect.c
+++ b/sbin/badsect/badsect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: badsect.c,v 1.13 2004/03/03 05:03:36 tedu Exp $ */
+/* $OpenBSD: badsect.c,v 1.14 2004/08/08 19:04:25 deraadt Exp $ */
/* $NetBSD: badsect.c,v 1.10 1995/03/18 14:54:28 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)badsect.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: badsect.c,v 1.13 2004/03/03 05:03:36 tedu Exp $";
+static const char rcsid[] = "$OpenBSD: badsect.c,v 1.14 2004/08/08 19:04:25 deraadt Exp $";
#endif
#endif /* not lint */
@@ -101,19 +101,19 @@ main(int argc, char *argv[])
fprintf(stderr, "usage: badsect bbdir blkno [ blkno ]\n");
exit(1);
}
- if (chdir(argv[1]) < 0 || stat(".", &stbuf) < 0)
+ if (chdir(argv[1]) < 0 || stat(".", &stbuf) < 0)
err(2, "%s", argv[1]);
-
+
strlcpy(name, _PATH_DEV, sizeof name);
len = strlen(name);
- if ((dirp = opendir(name)) == NULL)
+ if ((dirp = opendir(name)) == NULL)
err(3, "%s", name);
-
+
while ((dp = readdir(dirp)) != NULL) {
strlcpy(&name[len], dp->d_name, sizeof name - len);
- if (stat(name, &devstat) < 0)
+ if (stat(name, &devstat) < 0)
err(4, "%s", name);
-
+
if (stbuf.st_dev == devstat.st_rdev &&
S_ISBLK(devstat.st_mode))
break;
@@ -129,13 +129,13 @@ main(int argc, char *argv[])
name[len] = 'r';
strlcpy(&name[len+1], dp->d_name, sizeof name - (len+1));
closedir(dirp);
- if (dp == NULL)
+ if (dp == NULL)
err(5, "Cannot find dev 0%o corresponding to %s\n",
stbuf.st_rdev, argv[1]);
-
- if ((fsi = open(name, 0)) < 0)
+
+ if ((fsi = open(name, 0)) < 0)
err(6, "%s", name);
-
+
fs = &sblock;
rdfs(SBOFF, SBSIZE, (char *)fs);
dev_bsize = fs->fs_fsize / fsbtodb(fs, 1);