diff options
author | Simon McVittie <smcv@debian.org> | 2015-11-24 09:21:12 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2015-12-02 18:51:08 +0000 |
commit | 5a3e7de9d631d5de0700c3144f34aecee5cf222c (patch) | |
tree | e27139166bc045c16456ea6054931e33668a8083 | |
parent | 085f9348a1672107a4f0299d70464887b40731e4 (diff) | |
download | dbus-5a3e7de9d631d5de0700c3144f34aecee5cf222c.tar.gz |
_dbus_test_oom_handling: allow disabling it as documented
We documented DBUS_TEST_MALLOC_FAILURES=0 in HACKING, but it didn't
actually work: we'd iterate from i=-1 to i=0.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
-rw-r--r-- | dbus/dbus-internals.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 30a5fa73..d7ef0893 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -1066,6 +1066,12 @@ _dbus_test_oom_handling (const char *description, max_failures_to_try = 4; } + if (max_failures_to_try < 1) + { + _dbus_verbose ("not testing OOM handling\n"); + return TRUE; + } + i = setting ? max_failures_to_try - 1 : 1; while (i < max_failures_to_try) { |