aboutsummaryrefslogtreecommitdiff
path: root/lib/System
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-27 17:14:10 +0000
committerDan Gohman <gohman@apple.com>2010-05-27 17:14:10 +0000
commit02d5824266342ea06d7a01681fccdbd96d4afd04 (patch)
tree17b707cac52cf9616492feed5096542fb64e18f9 /lib/System
parent130de9c0b49d98983a5eb059fb5a89896f58d533 (diff)
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
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Unix/Path.inc4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 74596dc6ab..185f7fd66b 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;
}