liblttng-ctl: use export list to define exported symbols
[lttng-tools.git] / src / bin / lttng-sessiond / rotate.c
index 30ec241249e5a1020b88b63ee01845122fbb9b2a..cdf95f353dbbfa2cb0ba276cdba6292d26dc92ae 100644 (file)
@@ -18,7 +18,6 @@
 #include <common/hashtable/utils.h>
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <common/credentials.h>
-#include <sys/eventfd.h>
 #include <sys/stat.h>
 #include <time.h>
 #include <signal.h>
@@ -48,8 +47,8 @@ int subscribe_session_consumed_size_rotation(struct ltt_session *session, uint64
        enum lttng_notification_channel_status nc_status;
        struct lttng_action *action;
        const struct lttng_credentials session_creds = {
-               .uid = session->uid,
-               .gid = session->gid,
+               .uid = LTTNG_OPTIONAL_INIT_VALUE(session->uid),
+               .gid = LTTNG_OPTIONAL_INIT_VALUE(session->gid),
        };
 
        session->rotate_condition = lttng_condition_session_consumed_size_create();
@@ -93,6 +92,8 @@ int subscribe_session_consumed_size_rotation(struct ltt_session *session, uint64
                goto end;
        }
 
+       /* Ensure this trigger is not visible to external users. */
+       lttng_trigger_set_hidden(session->rotate_trigger);
        lttng_trigger_set_credentials(
                        session->rotate_trigger, &session_creds);
 
@@ -105,7 +106,8 @@ int subscribe_session_consumed_size_rotation(struct ltt_session *session, uint64
        }
 
        ret = notification_thread_command_register_trigger(
-                       notification_thread_handle, session->rotate_trigger);
+                       notification_thread_handle, session->rotate_trigger,
+                       true);
        if (ret < 0 && ret != -LTTNG_ERR_TRIGGER_EXISTS) {
                ERR("Register trigger, %s", lttng_strerror(ret));
                ret = -1;
This page took 0.023793 seconds and 4 git commands to generate.