Fix: possible consumer sockets double close on cleanup
authorDavid Goulet <dgoulet@efficios.com>
Tue, 9 Jul 2013 16:28:41 +0000 (12:28 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 9 Jul 2013 16:28:41 +0000 (12:28 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/main.c

index a117a1f1cfc8dd12cd02049455dbe82384825e04..91e085290eb1221dc62cb801e0fd0fafe984eabb 100644 (file)
@@ -406,13 +406,13 @@ static void close_consumer_sockets(void)
        if (ustconsumer32_data.err_sock >= 0) {
                ret = close(ustconsumer32_data.err_sock);
                if (ret < 0) {
-                       PERROR("UST consumer32 err_sock close");
+                       PERROR("UST consumerd32 err_sock close");
                }
        }
        if (ustconsumer64_data.err_sock >= 0) {
                ret = close(ustconsumer64_data.err_sock);
                if (ret < 0) {
-                       PERROR("UST consumer64 err_sock close");
+                       PERROR("UST consumerd64 err_sock close");
                }
        }
        if (kconsumer_data.cmd_sock >= 0) {
@@ -424,13 +424,13 @@ static void close_consumer_sockets(void)
        if (ustconsumer32_data.cmd_sock >= 0) {
                ret = close(ustconsumer32_data.cmd_sock);
                if (ret < 0) {
-                       PERROR("UST consumer32 cmd_sock close");
+                       PERROR("UST consumerd32 cmd_sock close");
                }
        }
        if (ustconsumer64_data.cmd_sock >= 0) {
                ret = close(ustconsumer64_data.cmd_sock);
                if (ret < 0) {
-                       PERROR("UST consumer64 cmd_sock close");
+                       PERROR("UST consumerd64 cmd_sock close");
                }
        }
 }
@@ -1149,12 +1149,14 @@ error:
                if (ret) {
                        PERROR("close");
                }
+               consumer_data->err_sock = -1;
        }
        if (consumer_data->cmd_sock >= 0) {
                ret = close(consumer_data->cmd_sock);
                if (ret) {
                        PERROR("close");
                }
+               consumer_data->cmd_sock = -1;
        }
        if (consumer_data->metadata_sock.fd >= 0) {
                ret = close(consumer_data->metadata_sock.fd);
This page took 0.032508 seconds and 4 git commands to generate.