From: Timo Sirainen <[EMAIL PROTECTED]>

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.

See: http://bugs.debian.org/452330

Signed-off-by: LaMont Jones <[EMAIL PROTECTED]>
---
 mount/mount.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/mount/mount.c b/mount/mount.c
index 99ad970..b870eb6 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -1227,7 +1227,15 @@ 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) {
+           char mountprog[120];
+           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) {
                         && (fd = open(spec, O_RDONLY | O_NONBLOCK)) >= 0) {
 
          if (blkdev_get_size(fd, &size) == 0) {
-- 
1.5.3.6

-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to