From db016e0cb91e06a4ecfd5f62151ead6dba8a5e71 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 29 Sep 2005 10:06:27 +0000 Subject: fix --- util/fusermount.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'util') 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; } -- cgit v1.2.3