- /* UUID generation */
- uuid_generate(new_session->uuid);
- uuid_copy(*session_id, new_session->uuid);
+ /* Define session system path */
+ if (path != NULL) {
+ if (strstr(name, "auto-") == NULL) {
+ time(&rawtime);
+ timeinfo = localtime(&rawtime);
+ strftime(date_time, sizeof(date_time), "-%Y%m%d-%H%M%S", timeinfo);
+ } else {
+ date_time[0] = '\0';
+ }
+
+ if (asprintf(&new_session->path, "%s/%s%s", path, name, date_time) < 0) {
+ ret = -ENOMEM;
+ goto error_asprintf;
+ }
+ } else {
+ ERR("No session path given");
+ ret = -1;
+ goto error;
+ }