emit error message for incorrect GAUSSLOG

This commit is contained in:
liang_-123 2021-01-29 14:40:19 +08:00
parent d687ed5243
commit 43bd119bb4
1 changed files with 7 additions and 1 deletions

View File

@ -1785,7 +1785,9 @@ static void LogCtlCreateLogParentDirectory(void)
{
char* logdir = NULL;
/* create directory for profile log */
/* create directory for profile log.
* if EEXIST == errno, this directory may be created already, don't care this case.
*/
logdir = LogCtlGetLogDirectory(PROFILE_LOG_TAG, false);
if (0 == mkdir(logdir, S_IRWXU) || (EEXIST == errno)) {
/*
@ -1795,6 +1797,10 @@ static void LogCtlCreateLogParentDirectory(void)
* ignore its returned value of this case.
*/
(void)chmod(logdir, S_IRWXU);
} else if (EEXIST != errno) {
ereport(FATAL,
(errmsg(
"could not create log directory \"%s\": %s\n", logdir, gs_strerror(errno))));
}
pfree(logdir);