From 32bbefe33a0e1c871decb142a9274b84bd6874e3 Mon Sep 17 00:00:00 2001 From: maliangzhu Date: Wed, 5 Aug 2020 11:24:55 +0800 Subject: [PATCH] Update main.c fix pid file error, if last pid is '12345' and new pid is '78' then pidfile will show 78@45 --- 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,