summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Siegl <stesie@brokenpipe.de>2005-12-09 19:52:37 +0000
committerStefan Siegl <stesie@brokenpipe.de>2005-12-09 19:52:37 +0000
commit5c2acce36614e8905dfd98eb59286a55a5f6e607 (patch)
tree997e06a6125086478564db0800cedffa7fd32496
parent9f7ab1f09243659e8c66ecdbbca52d7d532c9d72 (diff)
don't expect opendir and releasedir operations to be available, if readdir is. this is for example not true for example-23/hello.c
-rw-r--r--netfs.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/netfs.c b/netfs.c
index a22b9dec1..1504f9d67 100644
--- a/netfs.c
+++ b/netfs.c
@@ -1478,10 +1478,7 @@ get_dirents_readdir(struct node *dir, int first_entry, int num_entries,
error_t err;
FUNC_PROLOGUE_NODE("get_dirents_readdir", dir);
- if(! (fuse_ops
- && fuse_ops->readdir
- && fuse_ops->opendir
- && fuse_ops->releasedir))
+ if(! (fuse_ops && fuse_ops->readdir))
FUNC_RETURN(EOPNOTSUPP);
fuse_dirh_t handle;
@@ -1511,7 +1508,8 @@ get_dirents_readdir(struct node *dir, int first_entry, int num_entries,
handle->parent = dir->nn;
handle->hdrpos = (struct dirent*) *data;
- if((err = fuse_ops->opendir(dir->nn->path, &dir->nn->info)))
+ if(fuse_ops->opendir
+ && (err = fuse_ops->opendir(dir->nn->path, &dir->nn->info)))
goto out;
if((err = fuse_ops->readdir(dir->nn->path, handle,
@@ -1522,7 +1520,8 @@ get_dirents_readdir(struct node *dir, int first_entry, int num_entries,
goto out;
}
- if((err = fuse_ops->releasedir(dir->nn->path, &dir->nn->info)))
+ if(fuse_ops->releasedir
+ && (err = fuse_ops->releasedir(dir->nn->path, &dir->nn->info)))
goto out;
*data_len -= handle->size; /* subtract number of bytes left in the