From 22b2510179b7a03f3d8a4b3c01275d0afaa0ba27 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sun, 9 Jul 2023 15:01:07 -0700 Subject: [PATCH] libsysprof-profile: ignore some errors used to break out of loop --- src/libsysprof-profile/sysprof-recording.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libsysprof-profile/sysprof-recording.c b/src/libsysprof-profile/sysprof-recording.c index 24733501..0aa0ee8f 100644 --- a/src/libsysprof-profile/sysprof-recording.c +++ b/src/libsysprof-profile/sysprof-recording.c @@ -254,7 +254,9 @@ stop_recording: /* Clear buffers and ensure the disk layer has access to them */ sysprof_capture_writer_flush (self->writer); - if (error != NULL) + /* Ignore error types we use to bail out of loops */ + if (!g_error_matches (error, DEX_ERROR, DEX_ERROR_TIMED_OUT) && + !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return dex_future_new_for_error (g_steal_pointer (&error)); return dex_future_new_for_boolean (TRUE);