summaryrefslogtreecommitdiffstats
path: root/mount/mount.c
diff options
context:
space:
mode:
authorKarel Zak2007-12-14 15:09:22 +0100
committerKarel Zak2007-12-17 10:03:13 +0100
commit351a93169ebb30295221c37a22726ff63137f2a5 (patch)
tree9f3489fdeed58ac4dbeb288f1e16c5d670ba86db /mount/mount.c
parenttests: redirect libblkid cache to BLKID_FILE (diff)
downloadkernel-qcow2-util-linux-351a93169ebb30295221c37a22726ff63137f2a5.tar.gz
kernel-qcow2-util-linux-351a93169ebb30295221c37a22726ff63137f2a5.tar.xz
kernel-qcow2-util-linux-351a93169ebb30295221c37a22726ff63137f2a5.zip
mount: hint about helper program if device doesn't exist
Addresses-Debian-Bug: #452330 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/mount.c')
-rw-r--r--mount/mount.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mount/mount.c b/mount/mount.c
index 99ad97033..917f62ac4 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -1227,7 +1227,13 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
" missing codepage or helper program, or other error"),
spec);
- if (stat(spec, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)
+ if (stat(spec, &statbuf) < 0) {
+ if (errno == ENOENT) /* network FS? */
+ error(_(
+ " (for several filesystems (e.g. nfs, cifs) you might\n"
+ " need a /sbin/mount.<type> helper program)"));
+
+ } else if (S_ISBLK(statbuf.st_mode)
&& (fd = open(spec, O_RDONLY | O_NONBLOCK)) >= 0) {
if (blkdev_get_size(fd, &size) == 0) {