From: Pierre-Marc Fournier Date: Tue, 9 Mar 2010 05:06:14 +0000 (-0500) Subject: don't close file descriptors twice X-Git-Tag: v1.9.1~661 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2c1ccefa04f76f4ed7ed2c6bd02b1144e3ba1582;p=lttng-ust.git don't close file descriptors twice --- diff --git a/libust/tracectl.c b/libust/tracectl.c index 874a1b4d..e0b93709 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 259931d0..89b918aa 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);