Clean code base from redundant verification
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index de14cdb432d977c6fb1fa2cf982e435a5c0063d5..0ee27efce03af5a5dfa7d6f07c8899c001626f10 100644 (file)
@@ -858,14 +858,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /*
-                                * No activity for this FD (poll
-                                * implementation).
-                                */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
@@ -1099,7 +1091,7 @@ static int relay_create_session(const struct lttcomm_relayd_hdr *recv_hdr,
 {
        int ret = 0;
        ssize_t send_ret;
-       struct relay_session *session;
+       struct relay_session *session = NULL;
        struct lttcomm_relayd_status_session reply;
        char session_name[LTTNG_NAME_MAX];
        char hostname[LTTNG_HOST_NAME_MAX];
@@ -1153,7 +1145,9 @@ send_reply:
                                send_ret);
                ret = -1;
        }
-
+       if (ret < 0 && session) {
+               session_put(session);
+       }
        return ret;
 }
 
@@ -3811,14 +3805,6 @@ restart:
 
                        health_code_update();
 
-                       if (!revents) {
-                               /*
-                                * No activity for this FD (poll
-                                * implementation).
-                                */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
This page took 0.023672 seconds and 4 git commands to generate.