Move to kernel style SPDX license identifiers
[lttng-tools.git] / src / common / health / health.c
index d2414ae5776cbd563e0df3cd1b0d1709979dd869..62e211419fe463c28ae5c64cb842f1038295bfc7 100644 (file)
@@ -1,22 +1,12 @@
 /*
- * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
- * Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License, version 2 only, as
- * published by the Free Software Foundation.
+ * 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.
  */
 
-#define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <assert.h>
 #include <inttypes.h>
 #include <stdio.h>
@@ -81,7 +71,7 @@ struct health_app *health_app_create(int nr_types)
        if (!ha) {
                return NULL;
        }
-       ha->flags = zmalloc(sizeof(*ha->flags));
+       ha->flags = zmalloc(sizeof(*ha->flags) * nr_types);
        if (!ha->flags) {
                goto error_flags;
        }
@@ -171,7 +161,7 @@ static int validate_state(struct health_app *ha, struct health_state *state)
        last = state->last;
        current = uatomic_read(&state->current);
 
-       ret = clock_gettime(CLOCK_MONOTONIC, &current_time);
+       ret = lttng_clock_gettime(CLOCK_MONOTONIC, &current_time);
        if (ret < 0) {
                PERROR("Error reading time\n");
                /* error */
This page took 0.024128 seconds and 4 git commands to generate.