mirror of
https://github.com/hufrea/byedpi.git
synced 2026-09-12 19:50:54 +05:00
Dump only if cache file is set, dont close stdout
This commit is contained in:
parent
5b894d5739
commit
081b537535
5
proxy.c
5
proxy.c
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user