Dump only if cache file is set, dont close stdout

This commit is contained in:
ruti 2026-02-11 15:22:27 +03:00
parent 5b894d5739
commit 081b537535

View File

@ -50,6 +50,9 @@ static void on_cancel(int sig) {
static void on_hup(int sig) {
FILE *f;
if (!params.cache_file) {
return;
}
if (!strcmp(params.cache_file, "-"))
f = stdout;
else
@ -60,7 +63,7 @@ static void on_hup(int sig) {
}
LOG(LOG_S, "dump cache\n");
dump_cache(params.mempool, f);
fclose(f);
if (f != stdout) fclose(f);
}