diff options
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index ca06c64219c..140438eb37e 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -18,10 +18,9 @@ #include <IceUtil/StringUtil.h> #include <Slice/Checksum.h> #include <Slice/FileTracker.h> +#include <IceUtil/FileUtil.h> #include <limits> - -#include <sys/stat.h> #include <string.h> using namespace std; @@ -725,14 +724,14 @@ Slice::Gen::generate(const UnitPtr& p) fileImplC = _dir + '/' + fileImplC; } - struct stat st; - if(stat(fileImplH.c_str(), &st) == 0) + IceUtilInternal::structstat st; + if(!IceUtilInternal::stat(fileImplH, &st)) { ostringstream os; os << fileImplH << "' already exists - will not overwrite"; throw FileException(__FILE__, __LINE__, os.str()); } - if(stat(fileImplC.c_str(), &st) == 0) + if(!IceUtilInternal::stat(fileImplC, &st)) { ostringstream os; os << fileImplC << "' already exists - will not overwrite"; |