mount: (new) use MNT_ERR_ for error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
47dea49b4c
commit
ba24923e97
|
@ -347,29 +347,28 @@ try_readonly:
|
||||||
case -EBUSY:
|
case -EBUSY:
|
||||||
warnx(_("%s is already mounted"), src);
|
warnx(_("%s is already mounted"), src);
|
||||||
return MOUNT_EX_USAGE;
|
return MOUNT_EX_USAGE;
|
||||||
}
|
case -MNT_ERR_NOFSTAB:
|
||||||
|
warnx(_("can't find %s in %s"), src ? src : tgt,
|
||||||
if (!tgt || (!src && !(mflags & MS_PROPAGATION))) {
|
|
||||||
if (!mnt_context_fstab_applied(cxt))
|
|
||||||
warnx(_("can't find %s in %s"), src ? src : tgt,
|
|
||||||
mnt_get_fstab_path());
|
mnt_get_fstab_path());
|
||||||
else if (mflags & MS_REMOUNT)
|
|
||||||
warnx(_("%s not mounted"), src ? src : tgt);
|
|
||||||
|
|
||||||
return MOUNT_EX_USAGE;
|
return MOUNT_EX_USAGE;
|
||||||
}
|
case -MNT_ERR_NOFSTYPE:
|
||||||
|
|
||||||
if (!mnt_context_get_fstype(cxt)) {
|
|
||||||
if (restricted)
|
if (restricted)
|
||||||
warnx(_("I could not determine the filesystem type, "
|
warnx(_("I could not determine the filesystem type, "
|
||||||
"and none was specified"));
|
"and none was specified"));
|
||||||
else
|
else
|
||||||
warnx(_("you must specify the filesystem type"));
|
warnx(_("you must specify the filesystem type"));
|
||||||
return MOUNT_EX_USAGE;
|
return MOUNT_EX_USAGE;
|
||||||
}
|
case -MNT_ERR_NOSOURCE:
|
||||||
return handle_generic_errors(rc, _("%s: mount failed"),
|
if (src)
|
||||||
tgt ? tgt : src);
|
warnx(_("can't find %s"), src);
|
||||||
|
else
|
||||||
|
warnx(_("mount source not defined"));
|
||||||
|
return MOUNT_EX_USAGE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return handle_generic_errors(rc, _("%s: mount failed"),
|
||||||
|
tgt ? tgt : src);
|
||||||
|
}
|
||||||
} else if (mnt_context_get_syscall_errno(cxt) == 0) {
|
} else if (mnt_context_get_syscall_errno(cxt) == 0) {
|
||||||
/*
|
/*
|
||||||
* mount(2) syscall success, but something else failed
|
* mount(2) syscall success, but something else failed
|
||||||
|
|
Loading…
Reference in New Issue