From cfe0fb4f1776ba22c994dddfd23d8d1e200ee6fc Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sun, 14 Jul 2019 22:15:06 +0200 Subject: [PATCH] daemon: add requester to GameModeClient Record the requester process id in the GameModeClient struct and add a getter for it. --- daemon/gamemode-context.c | 17 ++++++++++++++--- daemon/gamemode.h | 5 +++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/daemon/gamemode-context.c b/daemon/gamemode-context.c index e0351d6..f2d701a 100644 --- a/daemon/gamemode-context.c +++ b/daemon/gamemode-context.c @@ -57,6 +57,7 @@ POSSIBILITY OF SUCH DAMAGE. struct GameModeClient { _Atomic int refcount; /**executable; } +/** + * The process identifier of the requester. + */ +pid_t game_mode_client_get_requester(GameModeClient *client) +{ + assert(client != NULL); + return client->requester; +} + /** * The time that game mode was requested for the client. */ diff --git a/daemon/gamemode.h b/daemon/gamemode.h index 78418f0..255aafb 100644 --- a/daemon/gamemode.h +++ b/daemon/gamemode.h @@ -70,6 +70,11 @@ pid_t game_mode_client_get_pid(GameModeClient *client); */ const char *game_mode_client_get_executable(GameModeClient *client); +/** + * The process identifier of the requester. + */ +pid_t game_mode_client_get_requester(GameModeClient *client); + /** * The time that game mode was requested for the client. */