mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Avoid spamming down stderr with autosave messages.
This commit is contained in:
parent
56a4d1ddac
commit
eafd8d91d7
11
autosave.c
11
autosave.c
@ -42,6 +42,9 @@ struct autosave
|
|||||||
static int autosave_thread(void *data)
|
static int autosave_thread(void *data)
|
||||||
{
|
{
|
||||||
autosave_t *save = data;
|
autosave_t *save = data;
|
||||||
|
|
||||||
|
bool first_log = true;
|
||||||
|
|
||||||
while (!save->quit)
|
while (!save->quit)
|
||||||
{
|
{
|
||||||
autosave_lock(save);
|
autosave_lock(save);
|
||||||
@ -52,7 +55,13 @@ static int autosave_thread(void *data)
|
|||||||
FILE *file = fopen(save->path, "wb");
|
FILE *file = fopen(save->path, "wb");
|
||||||
if (file)
|
if (file)
|
||||||
{
|
{
|
||||||
SSNES_LOG("Autosaving SRAM to \"%s\"\n", save->path);
|
// Avoid spamming down stderr ... :)
|
||||||
|
if (first_log)
|
||||||
|
{
|
||||||
|
SSNES_LOG("Autosaving SRAM to \"%s\", will continue to autosave every %u seconds ...\n", save->path, save->interval);
|
||||||
|
first_log = false;
|
||||||
|
}
|
||||||
|
|
||||||
bool failed = false;
|
bool failed = false;
|
||||||
failed |= fwrite(save->buffer, 1, save->bufsize, file) != save->bufsize;
|
failed |= fwrite(save->buffer, 1, save->bufsize, file) != save->bufsize;
|
||||||
failed |= fflush(file) != 0;
|
failed |= fflush(file) != 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user