sysprof/0028-sysprof-live-unwinder-error-out-on-capture-failure.patch

32 lines
1012 B
Diff
Raw Normal View History

2024-11-27 17:36:40 +00:00
From 271be03e633489dde7ff8329d40bf0dc4dfeef8a Mon Sep 17 00:00:00 2001
From: Christian Hergert <chergert@redhat.com>
Date: Wed, 13 Nov 2024 15:41:33 -0800
2024-11-27 17:36:40 +00:00
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