aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mount_zfs
diff options
context:
space:
mode:
authorslashdd <[email protected]>2016-09-20 13:07:58 -0400
committerBrian Behlendorf <[email protected]>2016-09-20 10:07:58 -0700
commit792517389fad5c495a2738b61c2e9c65dedaaa9a (patch)
tree5eef2ac0ecc1db47b3f11ec4ba12a97b6427e1b7 /cmd/mount_zfs
parent25e2ab16be74cb37934e6736a1dc10fd50a00c56 (diff)
Change /etc/mtab to /proc/self/mounts
Fix misleading error message: "The /dev/zfs device is missing and must be created.", if /etc/mtab is missing. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Eric Desrochers <[email protected]> Closes #4680 Closes #5029
Diffstat (limited to 'cmd/mount_zfs')
-rw-r--r--cmd/mount_zfs/mount_zfs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c
index b78c91c7c..f6631a527 100644
--- a/cmd/mount_zfs/mount_zfs.c
+++ b/cmd/mount_zfs/mount_zfs.c
@@ -294,11 +294,11 @@ mtab_is_writeable(void)
struct stat st;
int error, fd;
- error = lstat(MNTTAB, &st);
+ error = lstat("/etc/mtab", &st);
if (error || S_ISLNK(st.st_mode))
return (0);
- fd = open(MNTTAB, O_RDWR | O_CREAT, 0644);
+ fd = open("/etc/mtab", O_RDWR | O_CREAT, 0644);
if (fd < 0)
return (0);
@@ -320,21 +320,21 @@ mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
mnt.mnt_freq = 0;
mnt.mnt_passno = 0;
- fp = setmntent(MNTTAB, "a+");
+ fp = setmntent("/etc/mtab", "a+");
if (!fp) {
(void) fprintf(stderr, gettext(
- "filesystem '%s' was mounted, but %s "
+ "filesystem '%s' was mounted, but /etc/mtab "
"could not be opened due to error %d\n"),
- dataset, MNTTAB, errno);
+ dataset, errno);
return (MOUNT_FILEIO);
}
error = addmntent(fp, &mnt);
if (error) {
(void) fprintf(stderr, gettext(
- "filesystem '%s' was mounted, but %s "
+ "filesystem '%s' was mounted, but /etc/mtab "
"could not be updated due to error %d\n"),
- dataset, MNTTAB, errno);
+ dataset, errno);
return (MOUNT_FILEIO);
}