Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logger: Fix crash bug when log rotate is enabled (groonga#1871)
This bug occurred in the following conditions. * When logging to a file * `--log-path <path>` * `--query-log-path <path>` * Log rotate is enabled * `--log-rotate-threshold-size <threshold>` * `--query-log-rotate-threshold-size <threshold>` * Process ID log output is enabled * `--log-flags process_id` When the log is rotated, `output->file` is closed and set to `NULL`. The crash occurs because of `flock(fileno(output->file), LOCK_UN);` in that state. This unlocking was only executed when outputting process ID to the log, so it occurred only when outputting process ID.
- Loading branch information