diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2018-09-28 13:03:38 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-10-15 04:05:30 +0000 |
commit | 76cc1ea613e038ced4bc6ae26233cb0681b63be5 (patch) | |
tree | ecca8321697c25951dbe94bb4b7d182040d567ac /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | c962e2cbd73e78f31e690f7b1f8456616006c543 (diff) |
libglusterfs/dict: Add sizeof()-1 variants of dict functions
One needs to be very careful about giving same key for the key and
SLEN(key) arguments in dict_xxxn() functions. Writing macros that
would take care of passing the SLEN(key) would help reduce this
burden on the developer and reviewer.
updates: bz#1193929
Change-Id: I312c479b919826570b47ae2c219c53e2f9b2ddef
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 5714e44e1f4..aa8892784df 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -3499,13 +3499,11 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo, data = dict_getn(this->options, "transport.socket.bind-address", SLEN("transport.socket.bind-address")); if (data) { - ret = dict_setn(options, "transport.socket.source-addr", - SLEN("transport.socket.source-addr"), data); + ret = dict_set_sizen(options, "transport.socket.source-addr", data); } data = dict_getn(this->options, "ping-timeout", SLEN("ping-timeout")); if (data) { - ret = dict_setn(options, "ping-timeout", SLEN("ping-timeout"), - data); + ret = dict_set_sizen(options, "ping-timeout", data); } } |