X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-registry.c;h=f9ddd25a5928e197d15834446fa9710ec665a44b;hp=26f306d52d516ac6091e74a1cb26ef73821dbbbd;hb=3d07185530211f3a650a7218199af44d4c77bf13;hpb=d7ba13889c8692b14f99238ddf2721ed78df89d2 diff --git a/src/bin/lttng-sessiond/ust-registry.c b/src/bin/lttng-sessiond/ust-registry.c index 26f306d52..f9ddd25a5 100644 --- a/src/bin/lttng-sessiond/ust-registry.c +++ b/src/bin/lttng-sessiond/ust-registry.c @@ -547,6 +547,7 @@ int ust_registry_session_init(struct ust_registry_session **sessionp, int byte_order, uint32_t major, uint32_t minor, + const char *root_shm_path, const char *shm_path, uid_t euid, gid_t egid) @@ -571,6 +572,9 @@ int ust_registry_session_init(struct ust_registry_session **sessionp, session->long_alignment = long_alignment; session->byte_order = byte_order; session->metadata_fd = -1; + strncpy(session->root_shm_path, root_shm_path, + sizeof(session->root_shm_path)); + session->root_shm_path[sizeof(session->root_shm_path) - 1] = '\0'; if (shm_path[0]) { strncpy(session->shm_path, shm_path, sizeof(session->shm_path)); @@ -676,4 +680,10 @@ void ust_registry_session_destroy(struct ust_registry_session *reg) PERROR("unlink"); } } + if (reg->root_shm_path[0]) { + /* + * Try deleting the directory hierarchy. + */ + (void) utils_recursive_rmdir(reg->root_shm_path); + } }