diff options
| author | Dan Gohman <gohman@apple.com> | 2010-05-27 17:14:10 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-05-27 17:14:10 +0000 |
| commit | 3e6fe4eb745332918a55fd8b1be97ade5ebe3083 (patch) | |
| tree | 17b707cac52cf9616492feed5096542fb64e18f9 /lib/System | |
| parent | 664c1d95d193d077b4040cd7428c90decea231c1 (diff) | |
| download | external_llvm-3e6fe4eb745332918a55fd8b1be97ade5ebe3083.zip external_llvm-3e6fe4eb745332918a55fd8b1be97ade5ebe3083.tar.gz external_llvm-3e6fe4eb745332918a55fd8b1be97ade5ebe3083.tar.bz2 | |
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.inc | 4 |
1 files changed, 1 insertions, 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; } |
