From 322c116a53bbf9137585ec99be136a759dcaf297 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 16 Mar 2010 13:11:20 -0400 Subject: [PATCH] [main] Handle OOM in reload watch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bus/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bus/main.c b/bus/main.c index 7f9e98f3..e3650f1b 100644 --- a/bus/main.c +++ b/bus/main.c @@ -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) {