net: don't return still-connecting fd.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 27 May 2014 03:47:29 +0000 (13:17 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 27 May 2014 03:47:29 +0000 (13:17 +0930)
commit77354575335e5ee900a4ba126d4d76e34b9273e8
treebc7cbe13fdbf17aef9433aafb9ba9ad136f4e603
parentebc67c3fc630b8c7e71880c4972f5f8cde3b9a53
net: don't return still-connecting fd.

If one connect failed, we'd return the other one without
waiting for the connect to complete.  This resulted in
read() returning 0, which was really weird.

The downside: the poll doesn't seem to time out when the
connect times out (Linux 3.13 x86-64).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/net/net.c