summaryrefslogtreecommitdiffstats
path: root/ctdb/common/system_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/common/system_common.c')
-rw-r--r--ctdb/common/system_common.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/ctdb/common/system_common.c b/ctdb/common/system_common.c
index 7fc7425b0db..01ac2bf2d7a 100644
--- a/ctdb/common/system_common.c
+++ b/ctdb/common/system_common.c
@@ -20,8 +20,6 @@
#include "includes.h"
#include "system/network.h"
-#include "system/filesys.h"
-#include <libgen.h>
/*
uint16 checksum for n bytes
@@ -159,50 +157,3 @@ char *ctdb_sys_find_ifname(ctdb_sock_addr *addr)
return NULL;
}
-
-int mkdir_p(const char *dir, int mode)
-{
- char t[PATH_MAX];
- ssize_t len;
- int ret;
-
- if (strcmp(dir, "/") == 0) {
- return 0;
- }
-
- if (strcmp(dir, ".") == 0) {
- return 0;
- }
-
- /* Try to create directory */
- ret = mkdir(dir, mode);
- /* Succeed if that worked or if it already existed */
- if (ret == 0 || errno == EEXIST) {
- return 0;
- }
- /* Fail on anything else except ENOENT */
- if (errno != ENOENT) {
- return ret;
- }
-
- /* Create ancestors */
- len = strlen(dir);
- if (len >= PATH_MAX) {
- errno = ENAMETOOLONG;
- return -1;
- }
- strncpy(t, dir, len+1);
-
- ret = mkdir_p(dirname(t), mode);
- if (ret != 0) {
- return ret;
- }
-
- /* Create directory */
- ret = mkdir(dir, mode);
- if ((ret == -1) && (errno == EEXIST)) {
- ret = 0;
- }
-
- return ret;
-}