1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-24 08:52:38 +02:00

Fix create_dir not working properly for OSX

This makes pg_rman working normally, caused by some OS-related subtility...
This commit is contained in:
Michael Paquier 2013-12-15 21:32:02 +09:00
parent ef59f85d0d
commit 3af0a65383

6
dir.c
View File

@ -42,9 +42,13 @@ dir_create_dir(const char *dir, mode_t mode)
strncpy(copy, dir, MAXPGPATH);
parent = dirname(copy);
/* Create parent first */
if (access(parent, F_OK) == -1)
dir_create_dir(parent, mode);
#ifdef MACOS
/* Create directory */
#ifdef __darwin__
if (mkdir(copy, mode) == -1)
#else
if (mkdir(dir, mode) == -1)