[sysprof/wip/chergert/sysprof-3] libsysprof: adopt FD that was created for us



commit 030f5e3dbdc459d32541a2ccc0ae95ec996783ff
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 10 14:52:40 2019 -0700

    libsysprof: adopt FD that was created for us

 src/libsysprof/sysprof-perf-counter.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libsysprof/sysprof-perf-counter.c b/src/libsysprof/sysprof-perf-counter.c
index ef445d3..2bc61cc 100644
--- a/src/libsysprof/sysprof-perf-counter.c
+++ b/src/libsysprof/sysprof-perf-counter.c
@@ -431,7 +431,10 @@ sysprof_perf_counter_open (SysprofPerfCounter     *self,
   g_return_val_if_fail (group_fd >= -1, -1);
 
   if (sysprof_helpers_perf_event_open (helpers, attr, pid, cpu, group_fd, flags, NULL, &out_fd, NULL))
-    return out_fd;
+    {
+      sysprof_perf_counter_take_fd (self, out_fd);
+      return out_fd;
+    }
 
   return -1;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]