From eadbb6a1903c5e8cb8ceeb65cf8f206bd7416485 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:38:54 +0000 Subject: [PATCH] Add session_get_parameters() Also add useful comment to session_send_term() --- sesman/sesexec/session.c | 10 ++++++++++ sesman/sesexec/session.h | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/sesman/sesexec/session.c b/sesman/sesexec/session.c index b76affdc..0a5bf572 100644 --- a/sesman/sesexec/session.c +++ b/sesman/sesexec/session.c @@ -973,12 +973,22 @@ session_get_start_time(const struct session_data *sd) return (sd == NULL) ? 0 : sd->start_time; } +/******************************************************************************/ +const struct session_parameters * +session_get_parameters(const struct session_data *sd) +{ + return (sd == NULL) ? NULL : &sd->params; +} + /******************************************************************************/ void session_send_term(struct session_data *sd) { if (sd != NULL && sd->win_mgr > 0) { + // Killing the window manager only is appropriate here. + // When we process SIGCHLD for the windowe manager, we + // will kill other processes as appropriate g_sigterm(sd->win_mgr); } } diff --git a/sesman/sesexec/session.h b/sesman/sesexec/session.h index 5cfab140..a1fdd4ab 100644 --- a/sesman/sesexec/session.h +++ b/sesman/sesexec/session.h @@ -103,10 +103,23 @@ session_active(const struct session_data *sd); * Returns the start time for an active session * * @param sd session_data for this session + * @return session start time */ time_t session_get_start_time(const struct session_data *sd); +/** + * Returns the parameters used to start the session + * + * @param sd session_data for this session + * @return Pointer to parameters + * + * The pointed-to data returned must not be modified in + * any way. + */ +const struct session_parameters * +session_get_parameters(const struct session_data *sd); + /*** * Ask a session to terminate by signalling the window manager *