[main] Handle OOM in reload watch

http://bugs.freedesktop.org/show_bug.cgi?id=12953

Wait for memory if we can't init the string.

Based on an original patch by Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
This commit is contained in:
Colin Walters 2010-03-16 13:11:20 -04:00
parent efc63e58da
commit 322c116a53

View file

@ -156,7 +156,10 @@ handle_reload_watch (DBusWatch *watch,
{
DBusError error;
DBusString str;
_dbus_string_init (&str);
while (!_dbus_string_init (&str))
_dbus_wait_for_memory ();
if ((reload_pipe[RELOAD_READ_END] > 0) &&
_dbus_read_socket (reload_pipe[RELOAD_READ_END], &str, 1) != 1)
{