- Minor changes for macos build
This commit is contained in:
21
jfile.cpp
21
jfile.cpp
@@ -50,7 +50,7 @@ char *resource_folder = NULL;
|
||||
DATA_File *data_file = NULL;
|
||||
int file_source = SOURCE_FILE;
|
||||
char scratch[255];
|
||||
std::string config_folder;
|
||||
static std::string config_folder;
|
||||
std::vector<keyvalue_t> config;
|
||||
|
||||
void file_setresourcefilename(const char *str) {
|
||||
@@ -156,7 +156,6 @@ void file_setconfigfolder(const char *foldername)
|
||||
struct stat st = {0};
|
||||
if (stat(config_folder.c_str(), &st) == -1)
|
||||
{
|
||||
errno = 0;
|
||||
#ifdef _WIN32
|
||||
int ret = mkdir(config_folder.c_str());
|
||||
#else
|
||||
@@ -165,24 +164,8 @@ void file_setconfigfolder(const char *foldername)
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
case EACCES:
|
||||
printf("the parent directory does not allow write");
|
||||
printf("ERROR CREATING CONFIG FOLDER.");
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
case EEXIST:
|
||||
printf("pathname already exists");
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
case ENAMETOOLONG:
|
||||
printf("pathname is too long");
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
default:
|
||||
perror("mkdir");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user