To reduce user confusion, if the /etc/mtab file is missing
ext2fs_check_mount_point and ext2fs_check_if_mounted will return a
new, explicit error code to indicate this case.
Addresses-Debian-Bug: #527859
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
ec EXT2_ET_IO_CHANNEL_NO_SUPPORT_64,
"I/O Channel does not support 64-bit block numbers"
+ec EXT2_NO_MTAB_FILE,
+ "Can't check if filesystem is mounted due to missing mtab file"
+
end
*mount_flags = 0;
if ((f = setmntent (mtab_file, "r")) == NULL)
- return errno;
+ return (errno == ENOENT ? EXT2_NO_MTAB_FILE : errno);
if (stat(file, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */