]> git.ozlabs.org Git - ccan/blobdiff - ccan/net/net.c
ccan/io: keep more io_plan details internal.
[ccan] / ccan / net / net.c
index 4c84ba7ac3b1702ac0467bb7e3fd29244eecf298..61efd5b8fd4b55643b157d3cf90e73818b2a20f4 100644 (file)
@@ -1,10 +1,7 @@
 /* Licensed under BSD-MIT - see LICENSE file for details */
 #include <ccan/net/net.h>
 #include <ccan/noerr/noerr.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 #include <poll.h>
-#include <netdb.h>
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -159,6 +156,9 @@ int net_connect_complete(struct pollfd pfds[2])
                        }
                        continue;
                }
+               if (!(pfds[i].revents & POLLOUT))
+                       continue;
+
                if (getsockopt(pfds[i].fd, SOL_SOCKET, SO_ERROR, &err,
                               &errlen) != 0) {
                        net_connect_abort(pfds);