From 94afe2ca98a8ed9effb05901fc89d3b7bb6d0d41 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Mon, 19 Dec 2016 16:28:06 +0530 Subject: glusterd: Propagate EADDRINUSE correctly to parent process exit()/_exit(): Only the least significant 8 bits i.e (err & 255) shall be available to the waiting parent process on calling _exit() or exit() with an integer exit status. If this number is negative, the parent process doesn't readily get what it's really looking forward to handle. For example: EADDRINUSE is 98 and if exit status code is set to -98, the waiting parent process shall get 158 (= -98 & 255) as exit status. BUG: 1193929 Change-Id: Idc6b0f40c2332e087e584b4b40cbf0d29168c9cd Signed-off-by: Prashanth Pai Reviewed-on: https://review.gluster.org/16200 NetBSD-regression: NetBSD Build System Reviewed-by: Amar Tumballi CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 2a9407f3bb4..96446f0a225 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1989,7 +1989,7 @@ retry: ret = runner_run (&runner); synclock_lock (&priv->big_lock); - if (ret == -EADDRINUSE) { + if (ret == EADDRINUSE) { /* retry after getting a new port */ gf_msg (this->name, GF_LOG_WARNING, -ret, GD_MSG_SRC_BRICK_PORT_UNAVAIL, -- cgit