sysprof/0028-sysprof-live-unwinder-error-out-on-capture-failure.patch
Christian Hergert 857a3982f5 Update to 47.2
Resolves: RHEL-69379
2024-11-27 09:59:15 -08:00

32 lines
1012 B
Diff

From 271be03e633489dde7ff8329d40bf0dc4dfeef8a Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Wed, 13 Nov 2024 15:41:33 -0800
Subject: [PATCH 28/33] sysprof-live-unwinder: error out on capture failure
---
src/sysprof-live-unwinder/main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/sysprof-live-unwinder/main.c b/src/sysprof-live-unwinder/main.c
index e14eaf6c..a1cd53fa 100644
--- a/src/sysprof-live-unwinder/main.c
+++ b/src/sysprof-live-unwinder/main.c
@@ -708,7 +708,13 @@ Examples:\n\
return EXIT_FAILURE;
}
- writer = sysprof_capture_writer_new_from_fd (g_steal_fd (&capture_fd), CAPTURE_BUFFER_SIZE);
+ if (!(writer = sysprof_capture_writer_new_from_fd (g_steal_fd (&capture_fd), CAPTURE_BUFFER_SIZE)))
+ {
+ int errsv = errno;
+ g_printerr ("Failed to create capture writer: %s\n",
+ g_strerror (errsv));
+ return EXIT_FAILURE;
+ }
if (all_perf_fds->len == 0)
{
--
2.45.2