diff options
author | Colin Walters <walters@verbum.org> | 2010-03-16 13:11:20 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-03-16 13:11:44 -0400 |
commit | 322c116a53bbf9137585ec99be136a759dcaf297 (patch) | |
tree | cc790e2493ead9a5fb5207a46d7941d646014dd8 | |
parent | efc63e58da6960fe1625f9795907787d33b4b0a8 (diff) | |
download | dbus-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) { |