Fix: relayd: add LPOLLERR to events
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index 3b9f6708a3685e61e0a6918e94732046a9b9151f..18b662c780f7a986f29c4e977583a7020c4bf411 100644 (file)
@@ -381,7 +381,7 @@ int create_thread_poll_set(struct lttng_poll_event *events, int size)
        }
 
        /* Add quit pipe */
-       ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN);
+       ret = lttng_poll_add(events, thread_quit_pipe[0], LPOLLIN | LPOLLERR);
        if (ret < 0) {
                goto error;
        }
@@ -1187,12 +1187,8 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr,
                goto end;
        }
 
-       ret = sscanf(VERSION, "%10u.%10u", &reply.major, &reply.minor);
-       if (ret < 2) {
-               ERR("Error in scanning version");
-               ret = -1;
-               goto end;
-       }
+       reply.major = RELAYD_VERSION_COMM_MAJOR;
+       reply.minor = RELAYD_VERSION_COMM_MINOR;
 
        /* Major versions must be the same */
        if (reply.major != be32toh(msg.major)) {
@@ -2114,6 +2110,10 @@ int main(int argc, char **argv)
        /* Set up max poll set size */
        lttng_poll_set_max_size();
 
+       /* Initialize communication library */
+       lttcomm_init();
+       lttcomm_inet_init();
+
        /* Setup the dispatcher thread */
        ret = pthread_create(&dispatcher_thread, NULL,
                        relay_thread_dispatcher, (void *) NULL);
This page took 0.035262 seconds and 4 git commands to generate.