summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-hooks.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-hooks.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.c b/xlators/mgmt/glusterd/src/glusterd-hooks.c
index 45a5912a1eb..cb3d38d2358 100644
--- a/xlators/mgmt/glusterd/src/glusterd-hooks.c
+++ b/xlators/mgmt/glusterd/src/glusterd-hooks.c
@@ -323,15 +323,16 @@ glusterd_hooks_run_hooks (char *hooks_path, glusterd_op_t op, dict_t *op_ctx,
{
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
- runner_t runner = {0, };
- struct dirent *entry = NULL;
+ runner_t runner = {0,};
DIR *hookdir = NULL;
+ struct dirent *entry = NULL;
+ struct dirent scratch[2] = {{0,},};
char *volname = NULL;
- char **lines = NULL;
- int N = 8; /*arbitrary*/
- int lineno = 0;
- int line_count = 0;
- int ret = -1;
+ char **lines = NULL;
+ int N = 8; /*arbitrary*/
+ int lineno = 0;
+ int line_count = 0;
+ int ret = -1;
this = THIS;
priv = this->private;
@@ -362,7 +363,7 @@ glusterd_hooks_run_hooks (char *hooks_path, glusterd_op_t op, dict_t *op_ctx,
ret = -1;
line_count = 0;
- GF_FOR_EACH_ENTRY_IN_DIR (entry, hookdir);
+ GF_FOR_EACH_ENTRY_IN_DIR (entry, hookdir, scratch);
while (entry) {
if (line_count == N-1) {
N *= 2;
@@ -376,7 +377,7 @@ glusterd_hooks_run_hooks (char *hooks_path, glusterd_op_t op, dict_t *op_ctx,
line_count++;
}
- GF_FOR_EACH_ENTRY_IN_DIR (entry, hookdir);
+ GF_FOR_EACH_ENTRY_IN_DIR (entry, hookdir, scratch);
}
lines[line_count] = NULL;