Give a meaningfull diagnostic when we cannot determine the filesystem type.
This commit is contained in:
parent
8e3124ba7d
commit
ca801c0301
@ -197,6 +197,8 @@ main(int argc, char *argv[])
|
|||||||
(fs = getfsspec(spec)) == NULL) {
|
(fs = getfsspec(spec)) == NULL) {
|
||||||
if (vfstype == NULL)
|
if (vfstype == NULL)
|
||||||
vfstype = getfslab(spec);
|
vfstype = getfslab(spec);
|
||||||
|
if (vfstype == NULL)
|
||||||
|
errx(1, "Could not determine filesystem type");
|
||||||
type = vfstype;
|
type = vfstype;
|
||||||
devcheck(spec);
|
devcheck(spec);
|
||||||
} else {
|
} else {
|
||||||
@ -555,7 +557,7 @@ getfslab(const char *str)
|
|||||||
err(1, "cannot open `%s'", str);
|
err(1, "cannot open `%s'", str);
|
||||||
|
|
||||||
if (ioctl(fd, DIOCGDINFO, &dl) == -1)
|
if (ioctl(fd, DIOCGDINFO, &dl) == -1)
|
||||||
err(1, "cannot get disklabel for `%s'", str);
|
return(NULL);
|
||||||
|
|
||||||
(void) close(fd);
|
(void) close(fd);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user