mount.nfs: print more useful error message
Subsystems (2)
PATCH 1/1 mount.nfs: print more useful error message
When mounting spec of a regular file, mount.nfs print error message as,
# mount -t nfs 127.0.0.1:/root/testfile /mnt/ mount.nfs: mount point /mnt is not a directory # mount -t nfs 127.0.0.1:/root/testfile /mnt/testfile mount.nfs: mount point /mnt/testfile is not a directory
This patch lets mount.nfs print more useful message,
# mount -t nfs 127.0.0.1:/root/testfile /mnt/ mount.nfs: mount spec 127.0.0.1:/root/testfile or point /mnt is not a directory # mount -t nfs 127.0.0.1:/root/testfile /mnt/testfile mount.nfs: mount point /mnt/testfile is not a directory
Signed-off-by Kinglong Mee <[email protected]>
--- utils/mount/error.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
utils/mount/error.c +6 -2
@@ -215,8 +215,12 @@ void mount_error(const char *spec, const char *mount_point, int error) progname);break ;case ENOTDIR : -nfs_error (_ ("%s: mount point %s is not a directory" ), - progname, mount_point); +if (spec) +nfs_error (_ ("%s: mount spec %s or point %s is not a " +"directory" ), progname, spec, mount_point); +else +nfs_error (_ ("%s: mount point %s is not a directory" ), + progname, mount_point);break ;case EBUSY : nfs_error(_("%s: %s is busy or already mounted"),
Signature · 1 line
1.9.0
Quoted 7 lines · Kinglong Mee
When mounting spec of a regular file, mount.nfs print error message as,
# mount -t nfs 127.0.0.1:/root/testfile /mnt/ mount.nfs: mount point /mnt is not a directory # mount -t nfs 127.0.0.1:/root/testfile /mnt/testfile mount.nfs: mount point /mnt/testfile is not a directory
Quoted 8 lines
This patch lets mount.nfs print more useful message,
# mount -t nfs 127.0.0.1:/root/testfile /mnt/ mount.nfs: mount spec 127.0.0.1:/root/testfile or point /mnt is not a directory # mount -t nfs 127.0.0.1:/root/testfile /mnt/testfile mount.nfs: mount point /mnt/testfile is not a directorySigned-off-by Kinglong Mee <[email protected]>
Committed...
steved.
Quoted 24 lines
--- utils/mount/error.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)utils/mount/error.c +6
-2@@ -215,8 +215,12 @@ void mount_error(const char *spec, const char *mount_point, int error) progname);break ;case ENOTDIR : -nfs_error (_ ("%s: mount point %s is not a directory" ), - progname, mount_point); +if (spec) +nfs_error (_ ("%s: mount spec %s or point %s is not a " +"directory" ), progname, spec, mount_point); +else +nfs_error (_ ("%s: mount point %s is not a directory" ), + progname, mount_point);break ;case EBUSY : nfs_error(_("%s: %s is busy or already mounted"),