From cc7f1929ee4944d82919b7830062c8a422427b18 Mon Sep 17 00:00:00 2001 From: cchen676 Date: Wed, 18 Aug 2021 14:19:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20gs=5Fctl=20build=E5=A4=87=E6=9C=BA?= =?UTF-8?q?=E9=87=8D=E5=BB=BA=E6=97=B6=E6=8C=87=E5=AE=9A=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9B=AE=E5=BD=95,=E5=A4=B1=E8=B4=A5=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=8E=E8=87=AA=E5=8A=A8=E5=8C=96=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E7=BB=93=E6=9E=9C=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/pg_ctl/pg_ctl.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/bin/pg_ctl/pg_ctl.cpp b/src/bin/pg_ctl/pg_ctl.cpp index 62e433caa..cb2ee7cf2 100644 --- a/src/bin/pg_ctl/pg_ctl.cpp +++ b/src/bin/pg_ctl/pg_ctl.cpp @@ -3963,11 +3963,11 @@ static void find_nested_pgconf(const char** optlines, char* opt_name) while (isspace((unsigned char)*p)) { p++; } - pg_fatal( - _("There is nested config file in postgresql.conf: %sWhich is not supported by full build. " + pg_log(PG_WARNING, + _("There is nested config file in postgresql.conf: %sWhich is not supported by build. " "Please move out the nested config files from %s and comment the 'include' config in postgresql.conf.\n" - "You can add option '-q' to disable autostart during full build and restore the change manually " - "before starting gaussdb."), + "You can add option '-q' to disable autostart during build and restore the change manually " + "before starting gaussdb.\n"), p, pg_data); exit(1); @@ -3986,6 +3986,11 @@ static void check_nested_pgconf(void) config_file[MAXPGPATH - 1] = '\0'; optlines = readfile(config_file); + if (optlines == NULL) { + pg_log(PG_WARNING, _("%s cannot be opened.\n"), config_file); + exit(1); + } + for (int i = 0; i < (int)lengthof(optname); i++) { find_nested_pgconf((const char**)optlines, optname[i]); }