X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotify-apps.c;h=55a4b74fd56d2c5b733690784cec3e71b7c7af79;hb=670a26e4165562ab2dc5a16b9941f942e4f30996;hp=fee1843459e011d8ded0908c07fd317026d942b0;hpb=f9d2ba6ae32397fd818279ea90d3691c60f0e079;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notify-apps.c b/src/bin/lttng-sessiond/notify-apps.c index fee184345..55a4b74fd 100644 --- a/src/bin/lttng-sessiond/notify-apps.c +++ b/src/bin/lttng-sessiond/notify-apps.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2013 - David Goulet + * Copyright (C) 2013 David Goulet * - * 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 _LGPL_SOURCE @@ -51,8 +41,8 @@ static void *thread_application_notification(void *data) rcu_register_thread(); rcu_thread_online(); - health_register(health_sessiond, - HEALTH_SESSIOND_TYPE_APP_MANAGE_NOTIFY); + health_register(the_health_sessiond, + HEALTH_SESSIOND_TYPE_APP_MANAGE_NOTIFY); if (testpoint(sessiond_thread_app_manage_notify)) { goto error_testpoint; @@ -109,11 +99,6 @@ restart: revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - if (!revents) { - /* No activity for this FD (poll implementation). */ - continue; - } - /* Thread quit pipe has been closed. Killing thread. */ if (pollfd == quit_pipe_read_fd) { err = 0; @@ -200,7 +185,7 @@ error_testpoint: health_error(); ERR("Health error occurred in %s", __func__); } - health_unregister(health_sessiond); + health_unregister(the_health_sessiond); rcu_thread_offline(); rcu_unregister_thread(); return NULL; @@ -230,7 +215,7 @@ bool launch_application_notification_thread(int apps_cmd_notify_pipe_read_fd) notifiers = zmalloc(sizeof(*notifiers)); if (!notifiers) { - goto error; + goto error_alloc; } notifiers->apps_cmd_notify_pipe_read_fd = apps_cmd_notify_pipe_read_fd; @@ -252,5 +237,6 @@ bool launch_application_notification_thread(int apps_cmd_notify_pipe_read_fd) return true; error: cleanup_application_notification_thread(notifiers); +error_alloc: return false; }