dbus-spawn: don't leave bad file descriptors being watched
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 11 Jan 2011 19:57:31 +0000 (19:57 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 21 Jan 2011 15:00:25 +0000 (15:00 +0000)
commitca18baf83a6b9f1ac05fbdbf448517a4b4015768
tree6c651b735ce3bf6a8fbb44dd4580c3589dff389a
parentc894f62f2c33cd984805ec069ad3ca8684cbafe1
dbus-spawn: don't leave bad file descriptors being watched

The code called from handle_watch() might close either or both of the
sockets we're watching, without cleaning up the DBusWatch. This results
in invalid file descriptors being passed to _dbus_poll(), which could
end up busy-looping on a POLLNVAL condition until the babysitter loses
its last ref (which automatically clears up both watches).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32992
Bug-NB: NB#200248
Reviewed-by: Colin Walters <walters@verbum.org>
dbus/dbus-spawn.c