X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=bf6097b64609097b1cdf60d97400baf72098cc27;hb=d7ba13889c8692b14f99238ddf2721ed78df89d2;hp=06b015f937e3e12f2d2a360a3ac6223d3588b64b;hpb=d07ceecd2f35ccf383c7529a18dcc9b9c4b8cb17;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 06b015f93..bf6097b64 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3152,7 +3152,7 @@ int cmd_snapshot_record(struct ltt_session *session, int ret = LTTNG_OK; unsigned int use_tmp_output = 0; struct snapshot_output tmp_output; - unsigned int nb_streams, snapshot_success = 0; + unsigned int snapshot_success = 0; assert(session); assert(output); @@ -3333,6 +3333,29 @@ error: return ret; } +/* + * Command LTTNG_SET_SESSION_SHM_PATH processed by the client thread. + */ +int cmd_set_session_shm_path(struct ltt_session *session, + const char *shm_path) +{ + /* Safety net */ + assert(session); + + /* + * Can only set shm path before session is started. + */ + if (session->has_been_started) { + return LTTNG_ERR_SESSION_STARTED; + } + + strncpy(session->shm_path, shm_path, + sizeof(session->shm_path)); + session->shm_path[sizeof(session->shm_path) - 1] = '\0'; + + return 0; +} + /* * Init command subsystem. */