diff options
author | Jose <jose@zeroc.com> | 2009-07-29 21:50:06 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-07-29 21:50:06 +0200 |
commit | db9adf0e14f01d0aa8eb288a172995847c006f57 (patch) | |
tree | 9690b02e0f0c85377c0feedb18b3a203d73928fb /cpp/src/IcePatch2/Util.cpp | |
parent | bug 4003 - update bindist READMEs for bzip2 (diff) | |
download | ice-db9adf0e14f01d0aa8eb288a172995847c006f57.tar.bz2 ice-db9adf0e14f01d0aa8eb288a172995847c006f57.tar.xz ice-db9adf0e14f01d0aa8eb288a172995847c006f57.zip |
Changes for bug 3962 and 4714
Diffstat (limited to 'cpp/src/IcePatch2/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Util.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp index 05d91aa9bec..8e5c63dba4c 100644 --- a/cpp/src/IcePatch2/Util.cpp +++ b/cpp/src/IcePatch2/Util.cpp @@ -18,6 +18,7 @@ #include <IceUtil/DisableWarnings.h> #include <IceUtil/IceUtil.h> #include <IceUtil/StringUtil.h> +#include <IceUtil/FileUtil.h> #define ICE_PATCH2_API_EXPORTS #include <IcePatch2/Util.h> #include <openssl/sha.h> @@ -416,8 +417,8 @@ IcePatch2::remove(const string& pa) { const string path = simplify(pa); - OS::structstat buf; - if(OS::osstat(path, &buf) == -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(path, &buf) == -1) { throw "cannot stat `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -447,8 +448,8 @@ IcePatch2::removeRecursive(const string& pa) { const string path = simplify(pa); - OS::structstat buf; - if(OS::osstat(path, &buf) == -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(path, &buf) == -1) { throw "cannot stat `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -629,8 +630,8 @@ IcePatch2::createDirectoryRecursive(const string& pa) if(!isRoot(path + "/")) { - OS::structstat buf; - if(OS::osstat(path, &buf) != -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(path, &buf) != -1) { if(S_ISDIR(buf.st_mode)) { @@ -729,8 +730,8 @@ IcePatch2::decompressFile(const string& pa) // // The BZ2_bzReadOpen/BZ2_bzRead/BZ2_bzReadClose functions fail with BCC // - OS::structstat buf; - if(OS::osstat(pathBZ2, &buf) == -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(pathBZ2, &buf) == -1) { throw "cannot stat `" + pathBZ2 + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -854,8 +855,8 @@ IcePatch2::setFileFlags(const string& pa, const FileInfo& info) { #ifndef _WIN32 // Windows doesn't support the executable flag const string path = simplify(pa); - OS::structstat buf; - if(OS::osstat(path, &buf) == -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(path, &buf) == -1) { throw "cannot stat `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -889,8 +890,8 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G } else { - OS::structstat buf; - if(OS::osstat(getWithoutSuffix(path), &buf) == -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(getWithoutSuffix(path), &buf) == -1) { if(errno == ENOENT) { @@ -920,8 +921,8 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G else { - OS::structstat buf; - if(OS::osstat(path, &buf) == -1) + IceUtilInternal::structstat buf; + if(IceUtilInternal::stat(path, &buf) == -1) { throw "cannot stat `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } @@ -970,7 +971,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G info.executable = buf.st_mode & S_IXUSR; #endif - OS::structstat bufBZ2; + IceUtilInternal::structstat bufBZ2; const string pathBZ2 = path + ".bz2"; bool doCompress = false; if(buf.st_size != 0 && compress > 0) @@ -980,7 +981,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G // compress == 1: Compress if necessary. // compress >= 2: Always compress. // - if(compress >= 2 || OS::osstat(pathBZ2, &bufBZ2) == -1 || buf.st_mtime >= bufBZ2.st_mtime) + if(compress >= 2 || IceUtilInternal::stat(pathBZ2, &bufBZ2) == -1 || buf.st_mtime >= bufBZ2.st_mtime) { if(cb && !cb->compress(relPath)) { @@ -1191,7 +1192,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G rename(pathBZ2Temp, pathBZ2); - if(OS::osstat(pathBZ2, &bufBZ2) == -1) + if(IceUtilInternal::stat(pathBZ2, &bufBZ2) == -1) { throw "cannot stat `" + pathBZ2 + "':\n" + IceUtilInternal::lastErrorToString(); } |