diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 15:07:11 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-12 15:07:11 +0000 |
commit | b703be2544d4bab1d7c86b463eb1518e5e811948 (patch) | |
tree | 5ee79a035b2772a4c95eb780acd501b5246a5e79 /llvm/lib/Support/Unix | |
parent | e3e790a46ecf71521b3115dcfc4c3c0c09e25990 (diff) | |
download | bcm5719-llvm-b703be2544d4bab1d7c86b463eb1518e5e811948.tar.gz bcm5719-llvm-b703be2544d4bab1d7c86b463eb1518e5e811948.zip |
Remove Path::getMagicNumber.
llvm-svn: 183839
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index ecdc2abe3a8..57f02be1094 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -303,20 +303,6 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) { return Path(); } -bool Path::getMagicNumber(std::string &Magic, unsigned len) const { - assert(len < 1024 && "Request for magic string too long"); - char Buf[1025]; - int fd = ::open(path.c_str(), O_RDONLY); - if (fd < 0) - return false; - ssize_t bytes_read = ::read(fd, Buf, len); - ::close(fd); - if (ssize_t(len) != bytes_read) - return false; - Magic.assign(Buf, len); - return true; -} - bool Path::exists() const { return 0 == access(path.c_str(), F_OK ); |