On Wed, Sep 04, 2013 at 07:08:51PM +0200, Sebastian Ottlik wrote: > diff --git a/util/oslib-posix.c b/util/oslib-posix.c > index 3dc8b1b..f071793 100644 > --- a/util/oslib-posix.c > +++ b/util/oslib-posix.c > @@ -159,6 +159,20 @@ void qemu_set_nonblock(int fd) > fcntl(fd, F_SETFL, f | O_NONBLOCK); > } > > +int socket_set_fast_reuse(int fd) > +{ > + int val=1, ret; > + > + ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, > + (const char *)&val, sizeof(val)); > + > + if (ret < 0) { > + perror("setsockopt(SOL_SOCKET, SO_REUSEADDR)"); > + } > + > + return ret; > +}
Please run scripts/checkpatch.pl before submitting patches to check coding style (whitespace, indentation, etc).