From 3af0a65383dbd0ac9324d0ce4f6d8e9dd1219b67 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Sun, 15 Dec 2013 21:32:02 +0900 Subject: [PATCH] Fix create_dir not working properly for OSX This makes pg_rman working normally, caused by some OS-related subtility... --- dir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index e76120c9..9a5dcabc 100644 --- a/dir.c +++ b/dir.c @@ -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)