+ ptr->cached_errno= errno;
+ if (errno == EINPROGRESS || /* nonblocking mode - first return, */
+ errno == EALREADY) /* nonblocking mode - subsequent returns */
+ {
+ struct pollfd fds[1];
+ fds[0].fd = ptr->fd;
+ fds[0].events = POLLOUT;
+ int error= poll(fds, 1, ptr->root->connect_timeout);
+
+ if (error != 1 || fds[0].revents & POLLERR)