From f7342ad3a91ac5140e9c24e20007519847f4f4ec Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Mon, 17 Sep 2012 15:44:16 +0530 Subject: Clean up of typepunning errors ( Strict aliasing warnings ) Change-Id: I48733967facc526fb523a8dc9bd068f8c5cc5971 BUG: 764282 Signed-off-by: Varun Shastry Reviewed-on: http://review.gluster.org/3950 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/afr/src/afr-common.c') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index ddcd0bca37a..4130adc6f17 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -570,6 +570,7 @@ afr_hash_child (int32_t *success_children, int32_t child_count, unsigned int hmode, uuid_t gfid) { uuid_t gfid_copy = {0,}; + pid_t pid; if (!hmode) { return -1; @@ -588,7 +589,8 @@ afr_hash_child (int32_t *success_children, int32_t child_count, * perfection here. All we need is a low probability that * multiple clients won't converge on the same subvolume. */ - *((pid_t *)gfid_copy) = getpid(); + pid = getpid(); + memcpy (gfid_copy, &pid, sizeof(pid)); } return SuperFastHash((char *)gfid_copy, -- cgit