From a03053b717f1922a792751197ce2309249107e80 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sat, 21 Jan 2023 14:08:24 +0100 Subject: [PATCH] - Minor changes for macos build --- jfile.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/jfile.cpp b/jfile.cpp index b35775f..0a40cad 100644 --- a/jfile.cpp +++ b/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 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"); - 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); - } + printf("ERROR CREATING CONFIG FOLDER."); + exit(EXIT_FAILURE); } } }