Fix rk_mkdir() on WIN32
This commit is contained in:

committed by
Nico Williams

parent
db859520b4
commit
7138a04690
@@ -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
|
||||
}
|
||||
|
@@ -273,7 +273,7 @@ struct sockaddr_dl;
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DIRECT_H
|
||||
#ifdef WIN32
|
||||
#include <direct.h>
|
||||
#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)
|
||||
#endif
|
||||
|
||||
#ifdef MKDIR_DOES_NOT_HAVE_MODE
|
||||
#ifdef WIN32
|
||||
#define mkdir rk_mkdir
|
||||
#else
|
||||
#define rk_mkdir(__rk_rn_name, __rk_rn_mode) mkdir(__rk_rn_name,__rk_rn_mode)
|
||||
|
@@ -105,9 +105,6 @@ HCRYPTO_FALLBACK=1
|
||||
# Disable use of GSS LOCALNAME support
|
||||
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
|
||||
RENAME_DOES_NOT_UNLINK=1
|
||||
|
||||
|
Reference in New Issue
Block a user