This helps to avoid 'Address already in use' problems if server has been shut
down, and then restarted while sockets are still active on its port.
Created attachment 36620 [details] [review]
As far as I understand this is almost always the right thing to do for server sockets. GSocket exposes this as an option, but that's because a GSocket can be either a server or client. So let's go with this.
I stripped trailing whitespace from your patch and pushed to dbus-1.2. (This branch will at some point be merged into master)
Author: Sledz <sledz@MOBIL-400-586.intern.dresearch.de>
Date: Tue Jun 29 23:04:15 2010 +0200
sysdeps-unix: enable address reuse on TCP sockets
*** Bug 29889 has been marked as a duplicate of this bug. ***
Looks buggy because it sets error but then continues, potentially piling up two errors (which will assert). If you want to continue if setting this option fails, then don't set the error. If you want to fail the socket open entirely when setsockopt fails, you need to close fd and "goto failed." But it's never right to set error and then continue to other things that may also try to "pile up" an additional error.
DBusError (like GError or thrown exceptions) is always fatal to the current operation.
Created attachment 38332 [details] [review]
I attached a new version of the patch which treats the problems just as a warning and does not set an error.
Comment on attachment 38332 [details] [review]
> Looks good!
Can you push the patch than. I'm not allowed to do this.
Created attachment 38333 [details] [review]
change to warning
Fix to be a warning.
Created attachment 38334 [details] [review]
fix Werror in order to test the previous patch
My dbus checkout seems to be anongit, I think freedesktop may have nuked my ssh key a year or two ago, I forget what happened. anyhow here are the ready-to-apply patches.
Applied for the 1.4.0 release.