don't close file descriptors twice
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 9 Mar 2010 05:06:14 +0000 (00:06 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 9 Mar 2010 05:06:14 +0000 (00:06 -0500)
libust/tracectl.c
libustcomm/ustcomm.c

index 874a1b4d7e7bede3a6f1910094edebfdf3f91127..e0b9370963a482a206be9b358d4705ecae727e9c 100644 (file)
@@ -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);
index 259931d0be8e38a7811841e41218b7bb7cf9fa22..89b918aae5590bf24750e645df49922fb7fd2772 100644 (file)
@@ -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);
This page took 0.024603 seconds and 4 git commands to generate.