summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-12 14:16:52 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-12 14:16:52 +0000
commitec4f0fc7c17cb27c884f0e5e9b15e7e1de1b1883 (patch)
tree406e1604c4341b0aba970dd8a2c9854ab2fd115e /llvm/lib/Support/Unix
parent7e79636e1925a24b34f5e5c83822fa1b1e5a961f (diff)
downloadbcm5719-llvm-ec4f0fc7c17cb27c884f0e5e9b15e7e1de1b1883.tar.gz
bcm5719-llvm-ec4f0fc7c17cb27c884f0e5e9b15e7e1de1b1883.zip
Remove sys::CopyFile.
llvm-svn: 183831
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Path.inc47
1 files changed, 0 insertions, 47 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 7b236a56e11..b17b9f91dec 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -667,53 +667,6 @@ Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const {
}
bool
-sys::CopyFile(const sys::Path &Dest, const sys::Path &Src, std::string* ErrMsg){
- int inFile = -1;
- int outFile = -1;
- inFile = ::open(Src.c_str(), O_RDONLY);
- if (inFile == -1)
- return MakeErrMsg(ErrMsg, Src.str() +
- ": can't open source file to copy");
-
- outFile = ::open(Dest.c_str(), O_WRONLY|O_CREAT, 0666);
- if (outFile == -1) {
- ::close(inFile);
- return MakeErrMsg(ErrMsg, Dest.str() +
- ": can't create destination file for copy");
- }
-
- char Buffer[16*1024];
- while (ssize_t Amt = ::read(inFile, Buffer, 16*1024)) {
- if (Amt == -1) {
- if (errno != EINTR && errno != EAGAIN) {
- ::close(inFile);
- ::close(outFile);
- return MakeErrMsg(ErrMsg, Src.str()+": can't read source file");
- }
- } else {
- char *BufPtr = Buffer;
- while (Amt) {
- ssize_t AmtWritten = ::write(outFile, BufPtr, Amt);
- if (AmtWritten == -1) {
- if (errno != EINTR && errno != EAGAIN) {
- ::close(inFile);
- ::close(outFile);
- return MakeErrMsg(ErrMsg, Dest.str() +
- ": can't write destination file");
- }
- } else {
- Amt -= AmtWritten;
- BufPtr += AmtWritten;
- }
- }
- }
- }
- ::close(inFile);
- ::close(outFile);
- return false;
-}
-
-bool
Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
bool Exists;
if (reuse_current && (fs::exists(path, Exists) || !Exists))
OpenPOWER on IntegriCloud