- 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 = LTTCOMM_CREATE_FAIL;
- goto error;
+ /* Mkdir if we have a valid path 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 = LTTCOMM_CREATE_DIR_FAIL;
+ goto error;
+ }