From e8293edd54cca9e13f151b9f95b9bacfd3f09ebc Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 9 Jun 2023 16:35:04 -0700 Subject: [PATCH] libsysprof-profile: only create fdlist when necessary --- src/libsysprof-profile/sysprof-perf-event-stream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsysprof-profile/sysprof-perf-event-stream.c b/src/libsysprof-profile/sysprof-perf-event-stream.c index 4623b2e1..e4b32d5c 100644 --- a/src/libsysprof-profile/sysprof-perf-event-stream.c +++ b/src/libsysprof-profile/sysprof-perf-event-stream.c @@ -492,10 +492,11 @@ sysprof_perf_event_stream_new (GDBusConnection *connection, g_source_set_name (self->source, name); g_source_attach (self->source, NULL); - fd_list = g_unix_fd_list_new (); - if (group_fd > -1) - group_fd_handle = g_unix_fd_list_append (fd_list, group_fd, NULL); + { + fd_list = g_unix_fd_list_new (); + group_fd_handle = g_unix_fd_list_append (fd_list, group_fd, NULL); + } options = build_options_dict (attr);