client: Set the socket non-blocking only after connect succeeds
authorAmitay Isaacs <amitay@gmail.com>
Mon, 18 Mar 2013 02:45:08 +0000 (13:45 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 5 Apr 2013 02:21:41 +0000 (13:21 +1100)
commit524ec206e6a5e8b11723f4d8d1251ed5d84063b0
tree1a230306450a5881595d3a597395fa4522ec17c7
parent74acc2c568300ef42740cf11299a1b2507047f60
client: Set the socket non-blocking only after connect succeeds

If the socket is set non-blocking before connect, then we should catch
EAGAIN errors and retry. Instead of adding a random number of retries,
better to wait for connect to succeed and then set the socket to
non-blocking.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
client/ctdb_client.c
libctdb/ctdb.c