summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
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
commit78d1e84521024e9ad7b50fbaa83cd2bd29ee8703 (patch)
treebf95499ce487b5515269abc27fe2ea9d0077b044 /llvm/lib/System/Unix
parent16f4bd8140541425660f8e99506d2e1fe17d9241 (diff)
downloadbcm5719-llvm-78d1e84521024e9ad7b50fbaa83cd2bd29ee8703.tar.gz
bcm5719-llvm-78d1e84521024e9ad7b50fbaa83cd2bd29ee8703.zip
Don't bother clearing the Magic string when the magic number
can't be read, since it isn't cleared on other error paths. llvm-svn: 104852
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Path.inc4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 74596dc6ab0..185f7fd66bf 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud