Fix: remove dead code in relayd live code
[lttng-tools.git] / src / bin / lttng-relayd / live.c
index 887066f14c0822bd6c37c676a2fd7b82a79acf09..34114ad33872c88e7dfee1d3fc53b59a572ba18d 100644 (file)
@@ -350,7 +350,7 @@ void stop_threads(void)
 
        /* Stopping all threads */
        DBG("Terminating all live threads");
-       ret = notify_thread_pipe(live_conn_pipe[1]);
+       ret = notify_thread_pipe(thread_quit_pipe[1]);
        if (ret < 0) {
                ERR("write error on thread quit pipe");
        }
@@ -379,7 +379,7 @@ int create_thread_poll_set(struct lttng_poll_event *events, int size)
        }
 
        /* Add quit pipe */
-       ret = lttng_poll_add(events, live_conn_pipe[0], LPOLLIN | LPOLLERR);
+       ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN | LPOLLERR);
        if (ret < 0) {
                goto error;
        }
@@ -396,9 +396,9 @@ error:
  * Return 1 if it was triggered else 0;
  */
 static
-int check_live_conn_pipe(int fd, uint32_t events)
+int check_thread_quit_pipe(int fd, uint32_t events)
 {
-       if (fd == live_conn_pipe[0] && (events & LPOLLIN)) {
+       if (fd == thread_quit_pipe[0] && (events & LPOLLIN)) {
                return 1;
        }
 
@@ -515,7 +515,7 @@ restart:
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
                        /* Thread quit pipe has been closed. Killing thread. */
-                       ret = check_live_conn_pipe(pollfd, revents);
+                       ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
                                err = 0;
                                goto exit;
@@ -694,6 +694,7 @@ int viewer_connect(struct relay_connection *conn)
 
        health_code_update();
 
+       memset(&msg, 0, sizeof(msg));
        reply.major = RELAYD_VERSION_COMM_MAJOR;
        reply.minor = RELAYD_VERSION_COMM_MINOR;
 
@@ -947,10 +948,6 @@ int viewer_get_new_streams(struct relay_connection *conn)
        send_streams = 1;
        response.status = htobe32(LTTNG_VIEWER_NEW_STREAMS_OK);
 
-       if (!send_streams) {
-               goto send_reply;
-       }
-
        ret = make_viewer_streams(session, LTTNG_VIEWER_SEEK_LAST, NULL, &nb_unsent,
                        &nb_created);
        if (ret < 0) {
@@ -1081,10 +1078,6 @@ int viewer_attach_session(struct relay_connection *conn)
                goto send_reply;
        }
 
-       if (!send_streams) {
-               goto send_reply;
-       }
-
        ret = make_viewer_streams(session, seek_type, &nb_streams, NULL, NULL);
        if (ret < 0) {
                goto end_unlock;
@@ -1634,7 +1627,7 @@ int viewer_create_session(struct relay_connection *conn)
        DBG("Viewer create session received");
 
        resp.status = htobe32(LTTNG_VIEWER_CREATE_SESSION_OK);
-       conn->viewer_session = zmalloc(sizeof(conn->viewer_session));
+       conn->viewer_session = zmalloc(sizeof(*conn->viewer_session));
        if (!conn->viewer_session) {
                ERR("Allocation viewer session");
                resp.status = htobe32(LTTNG_VIEWER_CREATE_SESSION_ERR);
@@ -1854,7 +1847,7 @@ restart:
                        health_code_update();
 
                        /* Thread quit pipe has been closed. Killing thread. */
-                       ret = check_live_conn_pipe(pollfd, revents);
+                       ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
                                err = 0;
                                goto exit;
This page took 0.025446 seconds and 4 git commands to generate.