Fix: build failure with -fno-common
[lttng-tools.git] / tests / regression / tools / live / live_test.c
index cce6d10698375b19d727cc53109cd93184e8fc07..151e23fb6eb60089df712efcc51eacba017283af 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <time.h>
+#include <common/compat/time.h>
 #include <sys/types.h>
 #include <inttypes.h>
 #include <stdlib.h>
@@ -36,7 +36,6 @@
 #include <lttng/lttng.h>
 
 #include <urcu/list.h>
-#include <bin/lttng-sessiond/session.h>
 #include <common/common.h>
 
 #include <bin/lttng-relayd/lttng-viewer-abi.h>
@@ -52,9 +51,6 @@
 #define NUM_TESTS 11
 #define mmap_size 524288
 
-int ust_consumerd32_fd;
-int ust_consumerd64_fd;
-
 static int control_sock;
 struct live_session *session;
 
@@ -400,6 +396,7 @@ int get_metadata(void)
 
        rq.stream_id = htobe64(session->streams[metadata_stream_id].id);
 
+retry:
        ret_len = lttng_live_send(control_sock, &cmd, sizeof(cmd));
        if (ret_len < 0) {
                diag("Error sending cmd");
@@ -424,8 +421,8 @@ int get_metadata(void)
                break;
        case LTTNG_VIEWER_NO_NEW_METADATA:
                diag("Got LTTNG_VIEWER_NO_NEW_METADATA:");
-               ret = 0;
-               goto end;
+               usleep(50);
+               goto retry;
        case LTTNG_VIEWER_METADATA_ERR:
                diag("Got LTTNG_VIEWER_METADATA_ERR:");
                goto error;
@@ -455,7 +452,7 @@ int get_metadata(void)
        }
        free(data);
        ret = len;
-end:
+
        return ret;
 
 error_free_data:
@@ -694,6 +691,9 @@ int main(int argc, char **argv)
 
        ret = list_sessions(&session_id);
        ok(ret > 0, "List sessions : %d session(s)", ret);
+       if (ret < 0) {
+               goto end;
+       }
 
        ret = create_viewer_session();
        ok(ret == 0, "Create viewer session");
@@ -722,6 +722,6 @@ int main(int argc, char **argv)
 
        ret = attach_session(session_id);
        ok(ret > 0, "Attach to session, %d streams received", ret);
-
+end:
        return exit_status();
 }
This page took 0.024836 seconds and 5 git commands to generate.