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 04:20:21 +0000 (15:20 +1100)
commit17e11263cae9602da04d9af69cad0083bc29476d
tree5cd07b0f6306ccd81a29aeceb753f3e83b9dc7ce
parent184318ce3ec607af53c86ddf8e0e8f6d77313ea4
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>
(cherry picked from commit 524ec206e6a5e8b11723f4d8d1251ed5d84063b0)
client/ctdb_client.c
libctdb/ctdb.c