summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-03-16 13:11:20 -0400
committerColin Walters <walters@verbum.org>2010-03-16 13:11:44 -0400
commit322c116a53bbf9137585ec99be136a759dcaf297 (patch)
treecc790e2493ead9a5fb5207a46d7941d646014dd8
parentefc63e58da6960fe1625f9795907787d33b4b0a8 (diff)
downloaddbus-322c116a53bbf9137585ec99be136a759dcaf297.tar.gz
[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>
-rw-r--r--bus/main.c5
1 files changed, 4 insertions, 1 deletions
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)
{