From 47c3b5d2b03d3286cba2a3b4890e57fdd6135132 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 17 Sep 2016 00:28:00 +0200 Subject: Fix ICE-4787 - slice compilers and unicode paths --- cpp/src/Slice/JavaUtil.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'cpp/src/Slice/JavaUtil.cpp') diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp index 207b64fa6ea..3856e899202 100644 --- a/cpp/src/Slice/JavaUtil.cpp +++ b/cpp/src/Slice/JavaUtil.cpp @@ -13,9 +13,9 @@ #include #include #include +#include #include -#include #include #ifdef _WIN32 @@ -214,10 +214,8 @@ Slice::JavaOutput::openClass(const string& cls, const string& prefix, const stri path += dir.substr(start); } - struct stat st; - int result; - result = stat(path.c_str(), &st); - if(result == 0) + IceUtilInternal::structstat st; + if(!IceUtilInternal::stat(path, &st)) { if(!(st.st_mode & S_IFDIR)) { @@ -228,12 +226,8 @@ Slice::JavaOutput::openClass(const string& cls, const string& prefix, const stri } continue; } -#ifdef _WIN32 - result = _mkdir(path.c_str()); -#else - result = ::mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); -#endif - if(result != 0) + + if(IceUtilInternal::mkdir(path, 0777) != 0) { ostringstream os; os << "cannot create directory `" << path << "': " << strerror(errno); -- cgit v1.2.3