summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-11-29 16:01:23 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2006-11-29 16:01:23 +0000
commit04d12788678fe1c83c2dbd518774ab314d7db995 (patch)
tree7522158b599c39fc73ee5d2fae6d1d7c10f64d4e /util
parentfe621f9ae19a8c10a606015b5c5257f3bc72d68e (diff)
downloadfuse-04d12788678fe1c83c2dbd518774ab314d7db995.tar.gz
Print a more helpful message in case the kernel doesn't support the 'fuseblk' filesystem type
Diffstat (limited to 'util')
-rw-r--r--util/fusermount.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/util/fusermount.c b/util/fusermount.c
index 014d4ea..9326037 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -575,6 +575,23 @@ static int check_mountpoint_empty(const char *mnt, mode_t rootmode,
return 0;
}
+static int has_fuseblk(void)
+{
+ char buf[256];
+ FILE *f = fopen("/proc/filesystems", "r");
+ if (!f)
+ return 1;
+
+ while (fgets(buf, sizeof(buf), f))
+ if (strcmp(buf, "fuseblk\n") == 0) {
+ fclose(f);
+ return 1;
+ }
+
+ fclose(f);
+ return 0;
+}
+
static int do_mount(const char *mnt, const char **type, mode_t rootmode,
int fd, const char *opts, const char *dev, char **fsnamep,
char **mnt_optsp, off_t rootsize)
@@ -686,7 +703,11 @@ static int do_mount(const char *mnt, const char **type, mode_t rootmode,
res = mount(fsname, mnt, *type, flags, optbuf);
}
if (res == -1) {
- fprintf(stderr, "%s: mount failed: %s\n", progname, strerror(errno));
+ int errno_save = errno;
+ if (blkdev && errno == ENODEV && !has_fuseblk())
+ fprintf(stderr, "%s: 'fuseblk' support missing; try the kernel module from fuse-2.6.0 or later\n", progname);
+ else
+ fprintf(stderr, "%s: mount failed: %s\n", progname, strerror(errno_save));
goto err;
} else {
*fsnamep = fsname;