From 2c1ccefa04f76f4ed7ed2c6bd02b1144e3ba1582 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Tue, 9 Mar 2010 00:06:14 -0500 Subject: [PATCH] don't close file descriptors twice --- libust/tracectl.c | 6 ++++-- libustcomm/ustcomm.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libust/tracectl.c b/libust/tracectl.c index 874a1b4..e0b9370 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -1470,8 +1470,10 @@ static void ust_fork(void) /* Delete all blocked consumers */ list_for_each_entry(bc, &blocked_consumers, list) { - close(bc->fd_producer); - close(bc->fd_consumer); + result = close(bc->fd_producer); + if(result == -1) { + PERROR("close"); + } free(deletable_bc); deletable_bc = bc; list_del(&bc->list); diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 259931d..89b918a 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -421,8 +421,6 @@ int ustcomm_recv_message(struct ustcomm_server *server, char **msg, struct ustco if(retval == 0) { /* connection finished */ - close(fds[idx].fd); - list_for_each_entry(conn, &server->connections, list) { if(conn->fd == fds[idx].fd) { ustcomm_close_app(conn); -- 2.34.1