summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod_glusterfs/apache/2.2/src/mod_glusterfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mod_glusterfs/apache/2.2/src/mod_glusterfs.c b/mod_glusterfs/apache/2.2/src/mod_glusterfs.c
index a89e1c7b3..ee17ebb65 100644
--- a/mod_glusterfs/apache/2.2/src/mod_glusterfs.c
+++ b/mod_glusterfs/apache/2.2/src/mod_glusterfs.c
@@ -2785,7 +2785,7 @@ mod_glfs_index_directory (request_rec *r,
apr_size_t dirpathlen;
glusterfs_dir_config_t *dir_config = NULL;
int ret = -1;
- struct dirent entry = {0, };
+ struct dirent *entry = NULL;
struct stat st = {0, };
name = r->filename;
@@ -2994,12 +2994,12 @@ mod_glfs_index_directory (request_rec *r,
memcpy(fullpath, name, dirpathlen);
do {
- ret = glusterfs_readdir (fd, &entry, sizeof (entry));
- if (ret <= 0) {
+ entry = glusterfs_readdir (fd);
+ if (entry == NULL) {
break;
}
- fname = apr_pstrcat (r->pool, path, entry.d_name, NULL);
+ fname = apr_pstrcat (r->pool, path, entry->d_name, NULL);
ret = glusterfs_stat (fname, &st);
if (ret != 0) {
@@ -3007,7 +3007,7 @@ mod_glfs_index_directory (request_rec *r,
}
dirent.fname = fname;
- dirent.name = apr_pstrdup (r->pool, entry.d_name);
+ dirent.name = apr_pstrdup (r->pool, entry->d_name);
fill_out_finfo (&dirent, &st,
APR_FINFO_MIN | APR_FINFO_IDENT
| APR_FINFO_NLINK | APR_FINFO_OWNER