diff --git a/bufferevent_sock.c b/bufferevent_sock.c index 6bf8d197c6..eb1cc049e5 100644 --- a/bufferevent_sock.c +++ b/bufferevent_sock.c @@ -365,11 +365,10 @@ bufferevent_socket_connect(struct bufferevent *bev, if (fd < 0) { if (!sa) goto done; - fd = socket(sa->sa_family, SOCK_STREAM, 0); + fd = evutil_socket(sa->sa_family, + SOCK_STREAM|EVUTIL_SOCK_NONBLOCK, 0); if (fd < 0) goto done; - if (evutil_make_socket_nonblocking(fd)<0) - goto done; ownfd = 1; } if (sa) {