Fix: remove unused path variables from session obj
[lttng-tools.git] / src / bin / lttng-sessiond / session.c
index 076d2cbc46ea9243dbe636350d01592e6d40a880..17dc3544dbe55a4dac884b5af9f178e2f1c44991 100644 (file)
@@ -168,7 +168,7 @@ int session_destroy(struct ltt_session *session)
 /*
  * Create a brand new session and add it to the session list.
  */
-int session_create(char *name, char *path, uid_t uid, gid_t gid)
+int session_create(char *name, uid_t uid, gid_t gid)
 {
        int ret;
        struct ltt_session *new_session;
@@ -193,14 +193,6 @@ int session_create(char *name, char *path, uid_t uid, gid_t gid)
                goto error;
        }
 
-       /* Define session system path */
-       if (path != NULL) {
-               if (snprintf(new_session->path, PATH_MAX, "%s", path) < 0) {
-                       ret = LTTNG_ERR_FATAL;
-                       goto error_asprintf;
-               }
-       }
-
        /* Init kernel session */
        new_session->kernel_session = NULL;
        new_session->ust_session = NULL;
@@ -211,19 +203,6 @@ int session_create(char *name, char *path, uid_t uid, gid_t gid)
        new_session->uid = uid;
        new_session->gid = gid;
 
-       /* Mkdir if we have a valid path and length */
-       if (strlen(new_session->path) > 0) {
-               ret = run_as_mkdir_recursive(new_session->path, S_IRWXU | S_IRWXG,
-                               new_session->uid, new_session->gid);
-               if (ret < 0) {
-                       if (ret != -EEXIST) {
-                               ERR("Trace directory creation error");
-                               ret = LTTNG_ERR_CREATE_DIR_FAIL;
-                               goto error;
-                       }
-               }
-       }
-
        /* Add new session to the session list */
        session_lock_list();
        new_session->id = add_session_list(new_session);
@@ -234,8 +213,8 @@ int session_create(char *name, char *path, uid_t uid, gid_t gid)
         * up and, if valid, assign it to the session.
         */
 
-       DBG("Tracing session %s created in %s with ID %u by UID %d GID %d", name,
-                       path, new_session->id, new_session->uid, new_session->gid);
+       DBG("Tracing session %s created with ID %u by UID %d GID %d", name,
+                       new_session->id, new_session->uid, new_session->gid);
 
        return LTTNG_OK;
 
This page took 0.025059 seconds and 4 git commands to generate.