mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-07-31 18:36:53 +02:00
Run executables from PATH instead of /usr/bin
Not all distributions install non-system binaries into /usr/bin. For example, NixOS installs packages to /nix/store using a unique hash generated from the inputs used to build it: /nix/store/jld7jh3ilvbg91zvn1bdyawfc55b9jk8-polkit-0.118-bin/bin/pkexec
This commit is contained in:

committed by
afayaz-feral

parent
4000a32584
commit
126e67fb6b
@@ -235,7 +235,7 @@ static int game_mode_set_governor(GameModeContext *self, enum GameModeGovernor g
|
||||
}
|
||||
|
||||
const char *const exec_args[] = {
|
||||
"/usr/bin/pkexec", LIBEXECDIR "/cpugovctl", "set", gov_str, NULL,
|
||||
"pkexec", LIBEXECDIR "/cpugovctl", "set", gov_str, NULL,
|
||||
};
|
||||
|
||||
LOG_MSG("Requesting update of governor policy to %s\n", gov_str);
|
||||
|
@@ -167,7 +167,7 @@ int game_mode_apply_gpu(const GameModeGPUInfo *info)
|
||||
|
||||
// Set up our command line to pass to gpuclockctl
|
||||
const char *const exec_args[] = {
|
||||
"/usr/bin/pkexec",
|
||||
"pkexec",
|
||||
LIBEXECDIR "/gpuclockctl",
|
||||
device,
|
||||
"set",
|
||||
|
@@ -268,7 +268,7 @@ static int run_gamemoderun_and_reaper_tests(struct GameModeConfig *config)
|
||||
/* Close stdout, we don't care if sh prints anything */
|
||||
fclose(stdout);
|
||||
/* Preload into sh and then kill it */
|
||||
if (execl("/usr/bin/gamemoderun", "/usr/bin/gamemoderun", "sleep", "5", (char *)NULL) ==
|
||||
if (execlp("gamemoderun", "gamemoderun", "sleep", "5", (char *)NULL) ==
|
||||
-1) {
|
||||
LOG_ERROR("failed to launch gamemoderun with execl: %s\n", strerror(errno));
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user