Skip to content

Commit d89ecb3

Browse files
committed
libnilfs: fix error code when nilfs_open failed to find nilfs
In the current implementation, if nilfs_open() fails to retrieve an existing nilfs mount from the mount table, it returns an error with errno = ENOENT, resulting in inappropriate error messages, such as the following: $ lscp /dev/sdb1 lscp: cannot open NILFS on /dev/sdb1: No such file or directory Fix this issue by changing the error code set in errno to ENXIO. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
1 parent ad10d60 commit d89ecb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/nilfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int nilfs_find_fs(struct nilfs *nilfs, const char *dev, const char *dir,
241241
}
242242
}
243243
if (ret < 0)
244-
errno = ENOENT;
244+
errno = ENXIO;
245245

246246
failed_proc_mounts:
247247
fclose(fp);

0 commit comments

Comments
 (0)