Fix: Conditionally disable test requiring shared libs
[lttng-tools.git] / src / common / consumer.c
index 15fc9b09f800d6225be465b0d3c993e69a279f09..08592f6c0b8713f1ce1765a7de4d9237fd8bd81a 100644 (file)
@@ -2283,14 +2283,11 @@ void *consumer_thread_data_poll(void *data)
                 */
                pthread_mutex_lock(&consumer_data.lock);
                if (consumer_data.need_update) {
-                       if (pollfd != NULL) {
-                               free(pollfd);
-                               pollfd = NULL;
-                       }
-                       if (local_stream != NULL) {
-                               free(local_stream);
-                               local_stream = NULL;
-                       }
+                       free(pollfd);
+                       pollfd = NULL;
+
+                       free(local_stream);
+                       local_stream = NULL;
 
                        /* allocate for all fds + 1 for the consumer_data_pipe */
                        pollfd = zmalloc((consumer_data.stream_count + 1) * sizeof(struct pollfd));
@@ -2351,7 +2348,7 @@ void *consumer_thread_data_poll(void *data)
                 * array update over low-priority reads.
                 */
                if (pollfd[nb_fd].revents & (POLLIN | POLLPRI)) {
-                       size_t pipe_readlen;
+                       ssize_t pipe_readlen;
 
                        DBG("consumer_data_pipe wake up");
                        /* Consume 1 byte of pipe data */
@@ -2487,14 +2484,8 @@ void *consumer_thread_data_poll(void *data)
        }
 end:
        DBG("polling thread exiting");
-       if (pollfd != NULL) {
-               free(pollfd);
-               pollfd = NULL;
-       }
-       if (local_stream != NULL) {
-               free(local_stream);
-               local_stream = NULL;
-       }
+       free(pollfd);
+       free(local_stream);
 
        /*
         * Close the write side of the pipe so epoll_wait() in
This page took 0.02351 seconds and 4 git commands to generate.