Skip to content

Commit

Permalink
Save some syscalls when constructing a socket for a bufferevent
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Feb 10, 2012
1 parent 713e570 commit 33fca62
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bufferevent_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 33fca62

Please sign in to comment.