From 31066bb5b8fbfa95545893a3a81a358430bfdd44 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 1 Aug 2005 14:49:31 +0000 Subject: fix --- lib/fuse.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/fuse.c') diff --git a/lib/fuse.c b/lib/fuse.c index a849648..a798eaf 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -982,15 +982,14 @@ static void fuse_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) { struct fuse *f = req_fuse_prepare(req); - char *path; - int err; + char *path = NULL; + int err = 0; - err = -ENOENT; pthread_rwlock_rdlock(&f->tree_lock); - path = get_path(f, ino); - if (path != NULL) { - err = -ENOSYS; - if (f->op.open) { + if (f->op.open) { + err = -ENOENT; + path = get_path(f, ino); + if (path != NULL) { if (!f->compat) err = f->op.open(path, fi); else @@ -1011,7 +1010,7 @@ static void fuse_open(fuse_req_t req, fuse_ino_t ino, pthread_mutex_lock(&f->lock); if (fuse_reply_open(req, fi) == -ENOENT) { /* The open syscall was interrupted, so it must be cancelled */ - if(f->op.release) { + if(f->op.release && path != NULL) { if (!f->compat) f->op.release(path, fi); else -- cgit v1.2.3