Displaying 1 result from an estimated 1 matches for "set_error_suppression".
2020 May 07
1
[PATCH nbdkit] vddk: Suppress errors in can_extents test (RHBZ#1709211).
...,12 +164,37 @@ debug_function (const char *fs, va_list args)
nbdkit_debug ("%s", str);
}
+/* If the thread-local error_suppression pointer is non-NULL (we don't
+ * care about the actual value) then we will suppress error messages
+ * from VDDK in this thread.
+ */
+static void
+set_error_suppression (void)
+{
+ static const int one = 1; /* Something that gives us a non-NULL pointer. */
+ pthread_setspecific (error_suppression, &one);
+}
+
+static void
+clear_error_suppression (void)
+{
+ pthread_setspecific (error_suppression, NULL);
+}
+
+static bool
+are_errors_suppressed (void)
+{
+...