]> 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)
committerLaMont Jones <lamont@debian.org>
Mon, 17 Dec 2007 15:22:48 +0000 (08:22 -0700)
Addresses-Debian-Bug: #452330
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: LaMont Jones <lamont@debian.org>
mount/mount.c

index 6a154ae1a3cc562a43daf4a16c4820d10118ea99..63df235d783bc4c4869fad33174fc5e4b5d58dbd 100644 (file)
@@ -1196,8 +1196,14 @@ 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)
-          && (fd = open(spec, O_RDONLY | O_NONBLOCK)) >= 0) {
+       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 (ioctl(fd, BLKGETSIZE, &size) == 0) {
            if (size == 0 && !loop) {
              warned++;