Commit 5c345a1e authored by Rusty Russell's avatar Rusty Russell

io: fix io_connect().

How embarrassing: we weren't actually doing a non-blocking connect because
I was using F_SETFD instead of F_SETFL...
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 8b0bdb09
......@@ -403,8 +403,8 @@ struct io_plan io_connect_(int fd, const struct addrinfo *addr,
plan.next_arg = arg;
/* Save old flags, set nonblock if not already. */
plan.u1.s = fcntl(fd, F_GETFD);
fcntl(fd, F_SETFD, plan.u1.s | O_NONBLOCK);
plan.u1.s = fcntl(fd, F_GETFL);
fcntl(fd, F_SETFL, plan.u1.s | O_NONBLOCK);
/* Immediate connect can happen. */
if (connect(fd, addr->ai_addr, addr->ai_addrlen) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment