diff options
author | Jose <jose@zeroc.com> | 2009-11-27 00:20:42 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-11-27 00:20:42 +0100 |
commit | 7cdc3633275e1106de5aa17ee3ce4a0678227c15 (patch) | |
tree | 84358f440f4bec59988238490d7a3ac7226175cc /cpp/src/IcePatch2Lib/Util.cpp | |
parent | 4279 - alllTest.py fails to run if source path contains white spaces. (diff) | |
download | ice-7cdc3633275e1106de5aa17ee3ce4a0678227c15.tar.bz2 ice-7cdc3633275e1106de5aa17ee3ce4a0678227c15.tar.xz ice-7cdc3633275e1106de5aa17ee3ce4a0678227c15.zip |
4351 - Move _close & close to FileUtil.
Diffstat (limited to 'cpp/src/IcePatch2Lib/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch2Lib/Util.cpp | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/cpp/src/IcePatch2Lib/Util.cpp b/cpp/src/IcePatch2Lib/Util.cpp index e8699073978..0aeb63fbbf6 100644 --- a/cpp/src/IcePatch2Lib/Util.cpp +++ b/cpp/src/IcePatch2Lib/Util.cpp @@ -1085,11 +1085,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G stdioFile = IceUtilInternal::fopen(simplify(pathBZ2Temp), "wb"); if(!stdioFile) { -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - _close(fd); -#else - close(fd); -#endif + IceUtilInternal::close(fd); throw "cannot open `" + pathBZ2Temp + "' for writing:\n" + IceUtilInternal::lastErrorToString(); } @@ -1102,11 +1098,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G ex += string(": ") + IceUtilInternal::lastErrorToString(); } fclose(stdioFile); -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - _close(fd); -#else - close(fd); -#endif + IceUtilInternal::close(fd); throw ex; } } @@ -1130,12 +1122,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G fclose(stdioFile); } #endif - -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - _close(fd); -#else - close(fd); -#endif + IceUtilInternal::close(fd); throw "cannot read from `" + path + "':\n" + IceUtilInternal::lastErrorToString(); } bytesLeft -= static_cast<unsigned int>(bytes.size()); @@ -1153,11 +1140,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G } BZ2_bzWriteClose(&bzError, bzFile, 0, 0, 0); fclose(stdioFile); -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - _close(fd); -#else - close(fd); -#endif + IceUtilInternal::close(fd); throw ex; } } @@ -1166,11 +1149,7 @@ getFileInfoSeqInt(const string& basePath, const string& relPath, int compress, G SHA1_Update(&ctx, reinterpret_cast<const void*>(&bytes[0]), bytes.size()); } -#if defined(_MSC_VER) && (_MSC_VER >= 1400) - _close(fd); -#else - close(fd); -#endif + IceUtilInternal::close(fd); #ifndef __BCPLUSPLUS__ if(doCompress) |