On 09/10/2013 07:26 AM, Sebastian Ottlik wrote: > SO_REUSEADDR should be avoided on Windows but is desired on other operating > systems. So instead of setting it we call socket_set_fast_reuse that will > result > in the appropriate behaviour on all operating systems. > > Signed-off-by: Sebastian Ottlik <ott...@fzi.de> > --- > slirp/misc.c | 3 +-- > slirp/socket.c | 4 +--- > slirp/tcp_subr.c | 6 ++---- > slirp/udp.c | 4 ++-- > 4 files changed, 6 insertions(+), 11 deletions(-) > > diff --git a/slirp/misc.c b/slirp/misc.c > index c0d4899..6c1636f 100644 > --- a/slirp/misc.c > +++ b/slirp/misc.c > @@ -212,8 +212,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty) > so->s = accept(s, (struct sockaddr *)&addr, &addrlen); > } while (so->s < 0 && errno == EINTR); > closesocket(s); > - opt = 1; > - qemu_setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, &opt, > sizeof(int)); > + socket_set_fast_reuse(so->s);
Here's a case where the old code didn't care about failure, but the code in 1/5 results in a message via perror(). If that is intentional, it's best to mention it in the commit message. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature