提交 dd6b310e 编写于 作者: N Ning Yu

Fix callers of pg_mkdir_p()

Some callers of pg_mkdir_p() consider EEXIST as a non-error case, this
is incorrect.  When pg_mkdir_p() sets errno to EEXIST it means that the
target path already exists but is not a directory.  So as long as
pg_mkdir_p() returns -1 we should consider it as a failure.
Co-authored-by: NPaul Guo <pguo@pivotal.io>
Co-authored-by: NNing Yu <nyu@pivotal.io>
上级 c8d4e32f
......@@ -450,7 +450,7 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier)
snprintf(statusdir, sizeof(statusdir), "%s/pg_xlog/archive_status",
basedir);
if (pg_mkdir_p(statusdir, S_IRWXU) != 0 && errno != EEXIST)
if (pg_mkdir_p(statusdir, S_IRWXU) != 0)
{
fprintf(stderr,
_("%s: could not create directory \"%s\": %s\n"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册