correctly close bc fds on fork
[ust.git] / libust / tracectl.c
index 1dd71621e0e147ba471c97c02366de92171ccfea..83109a14c222d9f8719dc3710726f1a35a9544b6 100644 (file)
@@ -1128,6 +1128,13 @@ static void __attribute__((destructor)) keepalive()
        ustcomm_fini_app(&ustcomm_app);
 }
 
+void ust_potential_exec(void)
+{
+       trace_mark(ust, potential_exec, MARK_NOARGS);
+
+       keepalive();
+}
+
 /* Notify ust that there was a fork. This needs to be called inside
  * the new process, anytime a process whose memory is not shared with
  * the parent is created. If this function is not called, the events
@@ -1148,6 +1155,8 @@ void ust_fork(void)
 
        /* Delete all blocked consumers */
        list_for_each_entry(bc, &blocked_consumers, list) {
+               close(bc->fd_producer);
+               close(bc->fd_consumer);
                free(deletable_bc);
                deletable_bc = bc;
                list_del(&bc->list);
This page took 0.024256 seconds and 4 git commands to generate.