summaryrefslogtreecommitdiff
path: root/posix.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-28 02:34:23 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-28 02:34:23 +0200
commitba58914cb1476b94d1b6b2e42bc12471c37ea6b3 (patch)
tree4145e78eb837fa796b3b5d7b2c54b15ae1c373a5 /posix.c
parent8843785696053b63aa9113e6030979709bee4d68 (diff)
downloadmkdir_r-ba58914cb1476b94d1b6b2e42bc12471c37ea6b3.tar.gz
Allow user to specify OS-specific file mode flags
Diffstat (limited to 'posix.c')
-rw-r--r--posix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/posix.c b/posix.c
index d2d3651..4b8fde1 100644
--- a/posix.c
+++ b/posix.c
@@ -19,7 +19,7 @@
#include <sys/stat.h>
#include <sys/types.h>
-int mkdir_r_port(const char *const dir)
+int mkdir_r_port(const char *const dir, const int flags)
{
if (!access(dir, 0))
{
@@ -33,7 +33,7 @@ int mkdir_r_port(const char *const dir)
return -1;
}
}
- else if (mkdir(dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
+ else if (mkdir(dir, flags))
return -1;
return 0;