summaryrefslogtreecommitdiff
path: root/src/basic/mkdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/mkdir.c')
-rw-r--r--src/basic/mkdir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
index 6ab1b4422b..4bb65d5838 100644
--- a/src/basic/mkdir.c
+++ b/src/basic/mkdir.c
@@ -80,6 +80,12 @@ int mkdir_errno_wrapper(const char *pathname, mode_t mode) {
return 0;
}
+int mkdirat_errno_wrapper(int dirfd, const char *pathname, mode_t mode) {
+ if (mkdirat(dirfd, pathname, mode) < 0)
+ return -errno;
+ return 0;
+}
+
int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags) {
return mkdir_safe_internal(path, mode, uid, gid, flags, mkdir_errno_wrapper);
}