From 2a4005688c05e26439ce83c0b1da482e3c346ba9 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Jun 2013 15:07:11 +0000 Subject: Remove Path::getMagicNumber. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183839 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Path.inc | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'lib/Support/Unix') diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index ecdc2ab..57f02be 100644 --- a/lib/Support/Unix/Path.inc +++ b/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 ); -- cgit v1.1