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)
commit41f0252da22b97667ecdbc2235930d3b2523aa4d
tree0b57c18526eae8c8a55a66f927377a46160570bd
parentb1b3d6438010b7b32492aa3667059bbb3c8884d2
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>
(This used to be ctdb commit 524ec206e6a5e8b11723f4d8d1251ed5d84063b0)
ctdb/client/ctdb_client.c
ctdb/libctdb/ctdb.c