X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fio%2Fpoll.c;fp=ccan%2Fio%2Fpoll.c;h=8f77dd42d7c888acfb5dca50aea510304592b403;hp=078de1403ff8a886db059f14b2437799bab7edf3;hb=31df8231a077488a9f4010a8863ca38993aa69c8;hpb=0fbc79090f9ff5bc1caf8c0f0f05525a05f2e82d diff --git a/ccan/io/poll.c b/ccan/io/poll.c index 078de140..8f77dd42 100644 --- a/ccan/io/poll.c +++ b/ccan/io/poll.c @@ -78,6 +78,12 @@ 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); }