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

View File

@@ -273,7 +273,7 @@ struct sockaddr_dl;
#include <dirent.h> #include <dirent.h>
#endif #endif
#ifdef HAVE_DIRECT_H #ifdef WIN32
#include <direct.h> #include <direct.h>
#endif #endif
@@ -704,7 +704,7 @@ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL rk_rename(const char *, const char *);
#define rk_rename(__rk_rn_from,__rk_rn_to) rename(__rk_rn_from,__rk_rn_to) #define rk_rename(__rk_rn_from,__rk_rn_to) rename(__rk_rn_from,__rk_rn_to)
#endif #endif
#ifdef MKDIR_DOES_NOT_HAVE_MODE #ifdef WIN32
#define mkdir rk_mkdir #define mkdir rk_mkdir
#else #else
#define rk_mkdir(__rk_rn_name, __rk_rn_mode) mkdir(__rk_rn_name,__rk_rn_mode) #define rk_mkdir(__rk_rn_name, __rk_rn_mode) mkdir(__rk_rn_name,__rk_rn_mode)

View File

@@ -105,9 +105,6 @@ HCRYPTO_FALLBACK=1
# Disable use of GSS LOCALNAME support # Disable use of GSS LOCALNAME support
NO_LOCALNAME=1 NO_LOCALNAME=1
# Windows CRT mkdir does not have the mode parameter
MKDIR_DOES_NOT_HAVE_MODE=1
# Windows CRT rename does not unlink the target # Windows CRT rename does not unlink the target
RENAME_DOES_NOT_UNLINK=1 RENAME_DOES_NOT_UNLINK=1