mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-26 17:31:45 +02:00
Fix up error logging in game_mode_resolve_wine_preloader()
proc_path was never set to non-null but used for error logging, this triggered -Wformat-overflow warnings on GCC 9. Use the pid instead and remove that variable.
This commit is contained in:
@ -64,7 +64,7 @@ bool game_mode_detect_wine_loader(const char *exe)
|
|||||||
char *game_mode_resolve_wine_preloader(const pid_t pid)
|
char *game_mode_resolve_wine_preloader(const pid_t pid)
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX];
|
char buffer[PATH_MAX];
|
||||||
char *proc_path = NULL, *wine_exe = NULL, *wineprefix = NULL;
|
char *wine_exe = NULL, *wineprefix = NULL;
|
||||||
|
|
||||||
/* Open the directory, we are potentially reading multiple files from it */
|
/* Open the directory, we are potentially reading multiple files from it */
|
||||||
procfd_t proc_fd = game_mode_open_proc(pid);
|
procfd_t proc_fd = game_mode_open_proc(pid);
|
||||||
@ -143,7 +143,6 @@ char *game_mode_resolve_wine_preloader(const pid_t pid)
|
|||||||
error_cleanup:
|
error_cleanup:
|
||||||
game_mode_close_proc(proc_fd);
|
game_mode_close_proc(proc_fd);
|
||||||
free(wineprefix);
|
free(wineprefix);
|
||||||
free(proc_path);
|
|
||||||
return wine_exe;
|
return wine_exe;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@ -155,10 +154,10 @@ fail_cmdline:
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
|
|
||||||
fail_env:
|
fail_env:
|
||||||
LOG_ERROR("Failed to access process environment in '%s': %s\n", proc_path, strerror(errno));
|
LOG_ERROR("Failed to access process environment for client %d: %s\n", pid, strerror(errno));
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
|
|
||||||
fail_proc:
|
fail_proc:
|
||||||
LOG_ERROR("Failed to access process data in '%s': %s\n", proc_path, strerror(errno));
|
LOG_ERROR("Failed to access process data for client %d: %s\n", pid, strerror(errno));
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user