-static
-int session_mkdir(const struct ltt_session *session)
-{
- int ret;
- struct consumer_output *output;
- uid_t uid;
- gid_t gid;
-
- /*
- * Unsupported feature in lttng-relayd before 2.11, not an error since it
- * is only needed for session rotation and the user will get an error
- * on rotate.
- */
- if (session->consumer->type == CONSUMER_DST_NET &&
- session->consumer->relay_major_version == 2 &&
- session->consumer->relay_minor_version < 11) {
- ret = 0;
- goto end;
- }
-
- if (session->kernel_session) {
- output = session->kernel_session->consumer;
- uid = session->kernel_session->uid;
- gid = session->kernel_session->gid;
- ret = domain_mkdir(output, session, uid, gid);
- if (ret) {
- ERR("Mkdir kernel");
- goto end;
- }
- }
-
- if (session->ust_session) {
- output = session->ust_session->consumer;
- uid = session->ust_session->uid;
- gid = session->ust_session->gid;
- ret = domain_mkdir(output, session, uid, gid);
- if (ret) {
- ERR("Mkdir UST");
- goto end;
- }
- }
-
- ret = 0;
-
-end:
- return ret;
-}
-