fix(server,log): non-socket shutdown fallback, drop redundant delay cleanup, unlock logging I/O

This commit is contained in:
2026-09-13 02:13:22 +02:00
parent d28489d83c
commit ba1c7a369f
3 changed files with 71 additions and 53 deletions
+3 -1
View File
@@ -1376,9 +1376,11 @@ static bool cli_handle_io_options(CliParseCtx* ctx) {
return true;
}
if (config->log_file) {
/* Detach the logger before closing: log I/O may be in flight and must
never touch a freed FILE*. */
log_set_file(NULL);
fclose(config->log_file);
config->log_file = NULL;
log_set_file(NULL);
}
FILE* lf = fopen(ctx->argv[++ctx->i], "a");
if (!lf) {