fix
diff --git a/ChangeLog b/ChangeLog
index c2a8a98..48024ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-29 Miklos Szeredi <miklos@szeredi.hu>
+
+ * fusermount: fix error message, when unable to open /dev/fuse.
+ Report by Balázs Pozsár
+
2005-09-28 Miklos Szeredi <miklos@szeredi.hu>
* UClibc fixes from Christian Magnusson
diff --git a/util/fusermount.c b/util/fusermount.c
index 87dfaa8..0330cf9 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -774,18 +774,20 @@
static int try_open_fuse_device(char **devp)
{
int fd;
+ int err;
drop_privs();
- fd = try_open(FUSE_DEV_NEW, devp, 1);
+ fd = try_open(FUSE_DEV_NEW, devp, 0);
restore_privs();
if (fd >= 0)
return fd;
+ err = fd;
fd = try_open(FUSE_DEV_OLD, devp, 1);
if (fd >= 0)
return fd;
- return -1;
+ return err;
}
static int open_fuse_device(char **devp)
@@ -794,8 +796,10 @@
if (fd >= 0)
return fd;
- fprintf(stderr, "%s: fuse device not found, try 'modprobe fuse' first\n",
- progname);
+ if (fd == -2)
+ fprintf(stderr,
+ "%s: fuse device not found, try 'modprobe fuse' first\n",
+ progname);
return -1;
}