From 4c7ca7ec15760681703450dc9279a8c3cf8b98c0 Mon Sep 17 00:00:00 2001 From: Pranith K Date: Tue, 5 Oct 2010 07:34:45 +0000 Subject: mgmt/glusterd: send volume options to friend Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur BUG: 1816 (send volume options in friend add) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1816 --- libglusterfs/src/dict.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'libglusterfs/src/dict.c') diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index 0b0d777a0..454a7a67a 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -1235,18 +1235,20 @@ dict_foreach (dict_t *dict, void *data), void *data) { - if (!data) { - gf_log ("dict", GF_LOG_CRITICAL, - "@data=%p", data); - return; - } + if (!data || !dict) { + gf_log_callingfn ("dict", GF_LOG_CRITICAL, + "@data=%p, @dict=%p", data, dict); + return; + } - data_pair_t *pairs = dict->members_list; + data_pair_t *pairs = dict->members_list; + data_pair_t *next = NULL; - while (pairs) { - fn (dict, pairs->key, pairs->value, data); - pairs = pairs->next; - } + while (pairs) { + next = pairs->next; + fn (dict, pairs->key, pairs->value, data); + pairs = next; + } } -- cgit