If the file path passed in is not something on an xfs filesystem, print
a nice message about that instead of yelling about ioctls.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
}
if (ioctl(fd, XFS_IOC_FSGEOMETRY, geom) < 0) {
- perror("XFS_IOC_FSGEOMETRY");
+ if (errno == ENOTTY)
+ fprintf(stderr,
+_("%s: Not on a mounted XFS filesystem.\n"),
+ path);
+ else
+ perror("XFS_IOC_FSGEOMETRY");
close(fd);
return -1;
}