summaryrefslogtreecommitdiff
path: root/lib/Support/Windows/Path.inc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-12 15:07:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-12 15:07:11 +0000
commit2a4005688c05e26439ce83c0b1da482e3c346ba9 (patch)
treed0cc3ca82760f29542ee8ced6f87e7de1c3a803c /lib/Support/Windows/Path.inc
parent26ace5720d471dcff6ab6495f5898597cda54496 (diff)
Remove Path::getMagicNumber.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Path.inc')
-rw-r--r--lib/Support/Windows/Path.inc25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index 165c18f0a53..4a6e56350b4 100644
--- a/lib/Support/Windows/Path.inc
+++ b/lib/Support/Windows/Path.inc
@@ -590,31 +590,6 @@ Path::eraseFromDisk(bool remove_contents, std::string *ErrStr) const {
}
}
-bool Path::getMagicNumber(std::string& Magic, unsigned len) const {
- assert(len < 1024 && "Request for magic string too long");
- char* buf = reinterpret_cast<char*>(alloca(len));
-
- HANDLE h = CreateFile(path.c_str(),
- GENERIC_READ,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (h == INVALID_HANDLE_VALUE)
- return false;
-
- DWORD nRead = 0;
- BOOL ret = ReadFile(h, buf, len, &nRead, NULL);
- CloseHandle(h);
-
- if (!ret || nRead != len)
- return false;
-
- Magic = std::string(buf, len);
- return true;
-}
-
bool
Path::renamePathOnDisk(const Path& newName, std::string* ErrMsg) {
if (!MoveFileEx(path.c_str(), newName.c_str(), MOVEFILE_REPLACE_EXISTING))