From db016e0cb91e06a4ecfd5f62151ead6dba8a5e71 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 29 Sep 2005 10:06:27 +0000 Subject: [PATCH] fix --- ChangeLog | 5 +++++ util/fusermount.c | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2a8a98..48024ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-09-29 Miklos Szeredi + + * fusermount: fix error message, when unable to open /dev/fuse. + Report by Balázs Pozsár + 2005-09-28 Miklos Szeredi * 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(const char *dev, char **devp, int silent) 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 @@ static int open_fuse_device(char **devp) 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; } -- 2.30.2