Ensure we mkdir before spawning PID file

This commit is contained in:
2018-07-03 14:56:07 +03:00
parent d5cd9932a9
commit de956749cc
2 changed files with 6 additions and 4 deletions

View File

@@ -318,10 +318,9 @@ static int test_conf_syntax(void)
if (fopen_and_mkdir(conf.rmps.errlog) != 0)
failed = 1;
} else if (!strcmp(buf, "rmps.pidfile")) {
strcpy(conf.rmps.pidfile, tmp + 1);
/*if (fopen_and_mkdir(conf.rmps.pidfile) != 0)
* failed = 1;
*/
strncpy(conf.rmps.pidfile, tmp + 1, sizeof(conf.rmps.pidfile) - 1);
if (fopen_and_mkdir(conf.rmps.pidfile) != 0)
failed = 1;
} else if (!strcmp(buf, "rmps.loglevel")) {
if (strlen(tmp + 1) == 1 &&
(tmp[1] > '0' && tmp[1] < '5'))