Commit ce27b564 authored by Rusty Russell's avatar Rusty Russell

io: don't try to close() connection twice, remove shutdown logic.

We were closing before calling del_fd, which also closed.

The shutdown() logic applies when a child and parent are using the
*same* socket fd to communicate to each other.  That's really unusual
(who would you connect to?), and should probably be done by the user.

Generally, you'd use socketpair() for this child-parent case.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent c8f5d9df
......@@ -86,13 +86,6 @@ static void del_fd(struct fd *fd)
}
num_fds--;
fd->backend_info = -1;
/* Closing a local socket doesn't wake poll() because other end
* has them open. See 2.6. When should I use shutdown()?
* in http://www.faqs.org/faqs/unix-faq/socket/ */
shutdown(fd->fd, SHUT_RDWR);
close(fd->fd);
}
static void destroy_listener(struct io_listener *l)
......
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