summaryrefslogtreecommitdiffstats
path: root/sbin/dumpfs
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2003-01-19 01:02:25 +0000
committerjmallett <jmallett@FreeBSD.org>2003-01-19 01:02:25 +0000
commit4f8d2d71f0038c143c254adf5df01f4885649f3d (patch)
tree85c47950501ce02e5bb682186d4d2121cee961c6 /sbin/dumpfs
parent0a0a65bb423dc414c3e1520986bcbff86a7a1220 (diff)
downloadFreeBSD-src-4f8d2d71f0038c143c254adf5df01f4885649f3d.zip
FreeBSD-src-4f8d2d71f0038c143c254adf5df01f4885649f3d.tar.gz
Simplify the main function now that libufs will hunt for the disk for us.
Diffstat (limited to 'sbin/dumpfs')
-rw-r--r--sbin/dumpfs/dumpfs.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c
index 88d7b9a..697a363 100644
--- a/sbin/dumpfs/dumpfs.c
+++ b/sbin/dumpfs/dumpfs.c
@@ -91,26 +91,20 @@ void usage(void) __dead2;
int
main(int argc, char *argv[])
{
- struct fstab *fs;
- int ch, eval;
+ int eval;
- while ((ch = getopt(argc, argv, "")) != -1)
- switch(ch) {
- case '?':
- default:
- usage();
- }
+ eval = 0;
+
+ while (getopt(argc, argv, "") != -1)
+ usage();
argc -= optind;
argv += optind;
if (argc < 1)
usage();
- for (eval = 0; *argv; ++argv)
- if ((fs = getfsfile(*argv)) == NULL)
- eval |= dumpfs(*argv);
- else
- eval |= dumpfs(fs->fs_spec);
+ while (*argv != NULL)
+ eval |= dumpfs(*argv++);
exit(eval);
}
OpenPOWER on IntegriCloud