From a8c7759c7c54882cb5ffeb672d8c62d6315fb688 Mon Sep 17 00:00:00 2001 From: lukeman Date: Thu, 21 Dec 2023 16:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3issue=EF=BC=9A=E6=95=85?= =?UTF-8?q?=E9=9A=9C=E6=B3=A8=E5=85=A5=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E5=90=8EopenGauss=E5=90=AF=E5=8A=A8=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/postmaster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/process/postmaster/postmaster.cpp b/src/gausskernel/process/postmaster/postmaster.cpp index c6cec5e3d..1f7810d58 100644 --- a/src/gausskernel/process/postmaster/postmaster.cpp +++ b/src/gausskernel/process/postmaster/postmaster.cpp @@ -927,7 +927,7 @@ bool SetDBStateFileState(DbState state, bool optional) securec_check_intval(rc, , false); /* Write the new content into a temp file and rename it at last. */ - int fd = open(gaussdb_state_file, O_RDWR, 0); + int fd = open(gaussdb_state_file, O_RDONLY, 0); if (fd == -1) { if (errno == ENOENT && optional) { write_stderr("gaussdb.state does not exist, and skipt setting since it is optional."); @@ -945,7 +945,7 @@ bool SetDBStateFileState(DbState state, bool optional) write_stderr("Failed to read gaussdb.state: %d, len: %d", errno, len); (void)close(fd); (void)unlink(gaussdb_state_file); - return false; + return true; } if (close(fd) != 0) {