]> err.no Git - util-linux/commitdiff
mount: hint about helper program if device doesn't exist
authorKarel Zak <kzak@redhat.com>
Fri, 14 Dec 2007 14:09:22 +0000 (15:09 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 17 Dec 2007 09:03:13 +0000 (10:03 +0100)
Addresses-Debian-Bug: #452330
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/mount.c

index 99ad9703364004395298323fc3cebc19f3f7e76e..917f62ac4f269e69baa614cf4824246add98b29e 100644 (file)
@@ -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) {