Patch: Report missing helper program if mount device doesn't exist,
which most likely means a non-local filesystem mount which might need a
helper program.

I also removed the helper program from error text if device does exist.
I don't think there are any helpers for local filesystems?

--- mount.c.old 2007-11-27 09:32:49.000000000 +0200
+++ mount.c     2007-11-27 09:32:34.000000000 +0200
@@ -1193,11 +1193,18 @@
        error (_("mount: %s not mounted already, or bad option"), node);
       } else {
        error (_("mount: wrong fs type, bad option, bad superblock on %s,\n"
-              "       missing codepage or helper program, or other error"),
+              "       missing codepage, 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) {
+           char mountprog[100];
+           snprintf(mountprog, sizeof(mountprog), "/sbin/mount.%s", types);
+           if (stat(mountprog, &statbuf) < 0)
+             error(_("       You might need a helper program: %s"), mountprog);
+         }
+       } 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++;

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to