summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2Lib/Util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePatch2Lib/Util.cpp')
-rw-r--r--cpp/src/IcePatch2Lib/Util.cpp31
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)