From 1b1d251f174728c346395c915eeac4244cbdbb84 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 24 Nov 2015 09:21:12 +0000 Subject: [PATCH] _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 --- dbus/dbus-internals.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 30a5fa7..d7ef089 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) { -- 1.8.4.5