aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fuse.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-08-01 14:49:31 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-08-01 14:49:31 +0000
commit31066bb5b8fbfa95545893a3a81a358430bfdd44 (patch)
tree6fdefbc6ac219ee569c74097565e9a29323c37a1 /lib/fuse.c
parent009b878e22fae96037da5332937c436d48d7989e (diff)
downloadlibfuse-31066bb5b8fbfa95545893a3a81a358430bfdd44.tar.gz
fix
Diffstat (limited to 'lib/fuse.c')
-rw-r--r--lib/fuse.c15
1 files changed, 7 insertions, 8 deletions
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