From 8e973d3ab96d290a32ae3fdbdd1cf867b7060483 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Tue, 31 Oct 2017 09:56:11 -0700 Subject: core: make gf_boolean_t a C99 bool instead of an enum This reduces the space used from four bytes to one, and allows new code to use familiar C99 types/values interoperably with our old cruft. It does *not* change current declarations or code; that will be left for a separate - much larger - patch. Updates: #80 Change-Id: I5baedd17d3fb05b38f0d8b8bb9dd62824475842e Signed-off-by: Jeff Darcy --- xlators/protocol/client/src/client-handshake.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/protocol/client/src/client-handshake.c') diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 3cf2b06cb03..6fdea91fa38 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -1179,7 +1179,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m goto out; } - ret = dict_get_uint32 (reply, "child_up", &conf->child_up); + uint32_t child_up_int; + ret = dict_get_uint32 (reply, "child_up", &child_up_int); if (ret) { /* * This would happen in cases where the server trying to * @@ -1189,6 +1190,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED, "failed to find key 'child_up' in the options"); conf->child_up = _gf_true; + } else { + conf->child_up = (child_up_int != 0); } ret = dict_get_uint32 (reply, "clnt-lk-version", &lk_ver); -- cgit