Rename C++ header files to .hpp
[lttng-tools.git] / src / bin / lttng-sessiond / rotation-thread.cpp
index 8754d48a1d2eeb519d2273cba67332c01bf50f31..2f89fbc64ee875f8e94f5efc78b34e6a57648575 100644 (file)
@@ -8,34 +8,35 @@
 
 #define _LGPL_SOURCE
 #include <lttng/trigger/trigger.h>
-#include <common/error.h>
-#include <common/config/session-config.h>
-#include <common/defaults.h>
-#include <common/utils.h>
-#include <common/futex.h>
-#include <common/align.h>
-#include <common/time.h>
-#include <common/hashtable/utils.h>
+#include <common/error.hpp>
+#include <common/config/session-config.hpp>
+#include <common/defaults.hpp>
+#include <common/utils.hpp>
+#include <common/futex.hpp>
+#include <common/align.hpp>
+#include <common/time.hpp>
+#include <common/hashtable/utils.hpp>
 #include <sys/stat.h>
 #include <time.h>
 #include <signal.h>
 #include <inttypes.h>
 
-#include <common/kernel-ctl/kernel-ctl.h>
-#include <lttng/notification/channel-internal.h>
-#include <lttng/rotate-internal.h>
-#include <lttng/location-internal.h>
-
-#include "rotation-thread.h"
-#include "lttng-sessiond.h"
-#include "health-sessiond.h"
-#include "rotate.h"
-#include "cmd.h"
-#include "session.h"
-#include "timer.h"
-#include "notification-thread-commands.h"
-#include "utils.h"
-#include "thread.h"
+#include <common/kernel-ctl/kernel-ctl.hpp>
+#include <lttng/notification/channel-internal.hpp>
+#include <lttng/rotate-internal.hpp>
+#include <lttng/location-internal.hpp>
+#include <lttng/condition/condition-internal.hpp>
+
+#include "rotation-thread.hpp"
+#include "lttng-sessiond.hpp"
+#include "health-sessiond.hpp"
+#include "rotate.hpp"
+#include "cmd.hpp"
+#include "session.hpp"
+#include "timer.hpp"
+#include "notification-thread-commands.hpp"
+#include "utils.hpp"
+#include "thread.hpp"
 
 #include <urcu.h>
 #include <urcu/list.h>
@@ -214,7 +215,10 @@ void rotation_thread_enqueue_job(struct rotation_thread_timer_queue *queue,
                 * the job will be processed when the rotation_thread catches
                 * up.
                 */
+               DIAGNOSTIC_PUSH
+               DIAGNOSTIC_IGNORE_LOGICAL_OP
                if (errno == EAGAIN || errno == EWOULDBLOCK) {
+               DIAGNOSTIC_POP
                        /*
                         * Not an error, but would be surprising and indicate
                         * that the rotation thread can't keep up with the
@@ -560,7 +564,7 @@ int run_job(struct rotation_thread_job *job, struct ltt_session *session,
 
 static
 int handle_job_queue(struct rotation_thread_handle *handle,
-               struct rotation_thread *state,
+               struct rotation_thread *state __attribute__((unused)),
                struct rotation_thread_timer_queue *queue)
 {
        int ret = 0;
@@ -584,7 +588,7 @@ int handle_job_queue(struct rotation_thread_handle *handle,
                session = job->session;
                if (!session) {
                        DBG("Session \"%s\" not found",
-                                       session->name);
+                                       session->name != NULL ? session->name : "");
                        /*
                         * This is a non-fatal error, and we cannot report it to
                         * the user (timer), so just print the error and
@@ -659,10 +663,15 @@ int handle_condition(const struct lttng_condition *condition,
        session_lock_list();
        session = session_find_by_name(condition_session_name);
        if (!session) {
-               ret = -1;
-               session_unlock_list();
-               ERR("Session \"%s\" not found",
+               DBG("Failed to find session while handling notification: notification type = %s, session name = `%s`",
+                               lttng_condition_type_str(condition_type),
                                condition_session_name);
+               /*
+                * Not a fatal error: a session can be destroyed before we get
+                * the chance to handle the notification.
+                */
+               ret = 0;
+               session_unlock_list();
                goto end;
        }
        session_lock(session);
@@ -701,9 +710,9 @@ end:
 }
 
 static
-int handle_notification_channel(int fd,
+int handle_notification_channel(int fd __attribute__((unused)),
                struct rotation_thread_handle *handle,
-               struct rotation_thread *state)
+               struct rotation_thread *state __attribute__((unused)))
 {
        int ret;
        bool notification_pending;
This page took 0.027525 seconds and 4 git commands to generate.