From ca801c03017a1182cf1bdcc3da9b133663d13714 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 31 Oct 2002 15:32:39 +0000 Subject: [PATCH] Give a meaningfull diagnostic when we cannot determine the filesystem type. --- sbin/fsck/fsck.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index 37bb64bc5a2c..5a28651cf582 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);