]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
_dbus_test_oom_handling: allow disabling it as documented
authorSimon McVittie <smcv@debian.org>
Tue, 24 Nov 2015 09:21:12 +0000 (09:21 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 2 Dec 2015 18:51:08 +0000 (18:51 +0000)
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>
dbus/dbus-internals.c

index 30a5fa73bc91d091f8b8aa2493dada8631b2b67c..d7ef08933c01788043418d76411bb0bfcb402135 100644 (file)
@@ -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)
     {