summaryrefslogtreecommitdiffstats
path: root/sbin/fsck
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-31 15:32:39 +0000
committerphk <phk@FreeBSD.org>2002-10-31 15:32:39 +0000
commitca801c03017a1182cf1bdcc3da9b133663d13714 (patch)
tree4c3dd489186f85cd4dfe63c3287a97df9f9a858a /sbin/fsck
parent8e3124ba7d4f92584b87a9fad04976ca5d899286 (diff)
downloadFreeBSD-src-ca801c03017a1182cf1bdcc3da9b133663d13714.zip
FreeBSD-src-ca801c03017a1182cf1bdcc3da9b133663d13714.tar.gz
Give a meaningfull diagnostic when we cannot determine the filesystem type.
Diffstat (limited to 'sbin/fsck')
-rw-r--r--sbin/fsck/fsck.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 37bb64b..5a28651 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -197,6 +197,8 @@ main(int argc, char *argv[])
(fs = getfsspec(spec)) == NULL) {
if (vfstype == NULL)
vfstype = getfslab(spec);
+ if (vfstype == NULL)
+ errx(1, "Could not determine filesystem type");
type = vfstype;
devcheck(spec);
} else {
@@ -555,7 +557,7 @@ getfslab(const char *str)
err(1, "cannot open `%s'", str);
if (ioctl(fd, DIOCGDINFO, &dl) == -1)
- err(1, "cannot get disklabel for `%s'", str);
+ return(NULL);
(void) close(fd);
OpenPOWER on IntegriCloud