tests: Move to kernel style SPDX license identifiers
[lttng-tools.git] / tests / regression / tools / live / live_test.c
index 8a884ab6bf68d3b5d8cbc04cfcbfdcf609f70388..ee75c04f7ade0e0044a9636d1360b21f0ecd6d4a 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (c) - 2013 Julien Desfossez <jdesfossez@efficios.com>
+ * Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by as
- * published by the Free Software Foundation; only version 2 of the License.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <assert.h>
@@ -51,9 +41,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;
 
@@ -399,6 +386,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");
@@ -423,8 +411,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;
@@ -454,7 +442,7 @@ int get_metadata(void)
        }
        free(data);
        ret = len;
-end:
+
        return ret;
 
 error_free_data:
This page took 0.023825 seconds and 4 git commands to generate.