From 3e6fe4eb745332918a55fd8b1be97ade5ebe3083 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 27 May 2010 17:14:10 +0000 Subject: Don't bother clearing the Magic string when the magic number can't be read, since it isn't cleared on other error paths. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104852 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/Unix/Path.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index 74596dc..185f7fd 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -421,10 +421,8 @@ bool Path::getMagicNumber(std::string &Magic, unsigned len) const { return false; ssize_t bytes_read = ::read(fd, Buf, len); ::close(fd); - if (ssize_t(len) != bytes_read) { - Magic.clear(); + if (ssize_t(len) != bytes_read) return false; - } Magic.assign(Buf, len); return true; } -- cgit v1.1