summaryrefslogtreecommitdiff
path: root/trust/token.c
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-17 15:53:33 +0200
committerStef Walter <stef@thewalter.net>2013-07-18 06:53:11 +0200
commit3f9da410144fd45ee6250dda28cae49300077e29 (patch)
treec5ea2e0713907958ef1498e93f6547855ff11210 /trust/token.c
parent82738fe7d6143cb25fc1cb201a75b8a071043be8 (diff)
downloadp11-kit-3f9da410144fd45ee6250dda28cae49300077e29.tar.gz
Fixes for some recent win32 regressions
Diffstat (limited to 'trust/token.c')
-rw-r--r--trust/token.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/trust/token.c b/trust/token.c
index c91acd2..12e9e4c 100644
--- a/trust/token.c
+++ b/trust/token.c
@@ -572,11 +572,15 @@ writer_put_object (p11_save_file *file,
static bool
mkdir_with_parents (const char *path)
{
- int mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
char *parent;
bool ret;
+#ifdef OS_UNIX
+ int mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
if (mkdir (path, mode) == 0)
+#else
+ if (mkdir (path) == 0)
+#endif
return true;
switch (errno) {
@@ -586,7 +590,11 @@ mkdir_with_parents (const char *path)
ret = mkdir_with_parents (parent);
free (parent);
if (ret == true) {
+#ifdef OS_UNIX
if (mkdir (path, mode) == 0)
+#else
+ if (mkdir (path) == 0)
+#endif
return true;
}
}