diff --git a/daemon/gamemoded.c b/daemon/gamemoded.c index 55b8b271..a845283f 100644 --- a/daemon/gamemoded.c +++ b/daemon/gamemoded.c @@ -183,7 +183,8 @@ int main(int argc, char *argv[]) case 's': if (optarg != NULL) { pid_t pid = atoi(optarg); - switch (gamemode_query_status_for(pid)) { + int ret = gamemode_query_status_for(pid); + switch (ret) { case 0: /* inactive */ LOG_MSG("gamemode is inactive\n"); break; @@ -199,7 +200,7 @@ int main(int argc, char *argv[]) gamemode_error_string()); exit(EXIT_FAILURE); default: - LOG_ERROR("gamemode_query_status returned unexpected value 2\n"); + LOG_ERROR("gamemode_query_status returned unexpected value %d\n", ret); exit(EXIT_FAILURE); } } else { @@ -228,7 +229,8 @@ int main(int argc, char *argv[]) pid_t pid = atoi(optarg); /* toggle gamemode for the process */ - switch (gamemode_query_status_for(pid)) { + int ret = gamemode_query_status_for(pid); + switch (ret) { case 0: /* inactive */ case 1: /* active not not registered */ LOG_MSG("gamemode not active for client, requesting start for %d...\n", pid); @@ -255,6 +257,11 @@ int main(int argc, char *argv[]) pid, gamemode_error_string()); exit(EXIT_FAILURE); + default: + LOG_ERROR("gamemode_query_status_for(%d) returned unexpected value %d\n", + pid, + ret); + exit(EXIT_FAILURE); } } else { @@ -265,7 +272,8 @@ int main(int argc, char *argv[]) } /* Request and report on the status */ - switch (gamemode_query_status()) { + int ret = gamemode_query_status(); + switch (ret) { case 2: /* active for this client */ LOG_MSG("gamemode request succeeded and is active\n"); break; @@ -278,6 +286,9 @@ int main(int argc, char *argv[]) case -1: /* error */ LOG_ERROR("gamemode_query_status failed: %s\n", gamemode_error_string()); exit(EXIT_FAILURE); + default: + LOG_ERROR("gamemode_query_status returned unexpected value %d\n", ret); + exit(EXIT_FAILURE); } /* Simply pause and wait a SIGINT */ @@ -296,7 +307,8 @@ int main(int argc, char *argv[]) exit(EXIT_SUCCESS); case 'R': - switch (gamemode_request_restart()) { + int ret = gamemode_request_restart(); + switch (ret) { case 0: /* success */ LOG_MSG("gamemode restart succeeded\n"); exit(EXIT_SUCCESS); @@ -306,6 +318,9 @@ int main(int argc, char *argv[]) case -1: /* error */ LOG_ERROR("gamemode_request_restart failed: %s\n", gamemode_error_string()); break; + default: + LOG_ERROR("gamemode_request_restart returned unexpected value %d\n", ret); + break; } exit(EXIT_FAILURE); diff --git a/example/gamemode.ini b/example/gamemode.ini index 14dc9a01..67cf0887 100644 --- a/example/gamemode.ini +++ b/example/gamemode.ini @@ -16,7 +16,7 @@ desiredprof=performance igpu_desiredgov=powersave ; Threshold to use to decide when the integrated GPU is under heavy load. ; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the -; integraged GPU is under heavy enough load to justify switching to +; integrated GPU is under heavy enough load to justify switching to ; igpu_desiredgov. Set this to -1 to disable all iGPU checking and always ; use desiredgov for games. igpu_power_threshold=0.3 @@ -80,7 +80,7 @@ disable_splitlock=1 ;nv_mem_clock_mhz_offset=0 ; Whether the GPU supports per-profile editable options for core and memory clock offsets. -; NOTE: if thi is set to 0 (AllPerformanceLevels) then nv_powermizer_mode must be set to 0 +; NOTE: if this is set to 0 (AllPerformanceLevels) then nv_powermizer_mode must be set to 0 ;nv_per_profile_editable = 1 ; AMD specific settings