Fix rk_mkdir() on WIN32

This commit is contained in:
Nicolas Williams
2017-10-12 11:57:01 -05:00
committed by Nico Williams
parent db859520b4
commit 7138a04690
3 changed files with 7 additions and 13 deletions

View File

@@ -33,24 +33,21 @@
#include <config.h>
#ifdef HAVE_DIRECT_H
#ifdef WIN32
#include <direct.h>
#endif
#include "roken.h"
#ifdef MKDIR_DOES_NOT_HAVE_MODE
#undef mkdir
#else
#ifndef WIN32
#undef rk_mkdir
#endif
int ROKEN_LIB_FUNCTION
rk_mkdir(const char *pathname, mode_t mode)
{
#ifndef MKDIR_DOES_NOT_HAVE_MODE
return mkdir(pathname, mode);
#else
/* Windows does not provide the ability to set access permissions */
#ifdef WIN32
return _mkdir(pathname);
#else
return mkdir(pathname, mode);
#endif
}