From a8e6fbb887ad86f9c87b3f0b210eef1d35c6c62b Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Wed, 12 Aug 2020 16:07:04 +0900 Subject: [PATCH] At pgpool startup, if pid file exists, truncate pid file to zero length before writing. Patch is created by maliangzhu. --- src/main/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/main.c b/src/main/main.c index c463b0f3e..1c83cef70 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -656,7 +656,7 @@ write_pid_file(void) pool_config->pid_file_name))); } - fd = open(pid_file, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); + fd = open(pid_file, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (fd == -1) { ereport(FATAL, -- 2.39.5