aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-18 07:03:14 +0000
committerChris Lattner <sabre@nondot.org>2006-07-18 07:03:14 +0000
commit84bad2f96c42e62238bb29f6344eadd7006826b2 (patch)
tree938b6eadbfedff02cea744ce79203db32d7303a4 /lib/System
parent0af7093532751df4ba69a72f9ab136c682e00378 (diff)
downloadexternal_llvm-84bad2f96c42e62238bb29f6344eadd7006826b2.zip
external_llvm-84bad2f96c42e62238bb29f6344eadd7006826b2.tar.gz
external_llvm-84bad2f96c42e62238bb29f6344eadd7006826b2.tar.bz2
Remove a dead conditional: info_ can only be allocated if FD is good. Improve
spacing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Unix/MappedFile.inc9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/System/Unix/MappedFile.inc b/lib/System/Unix/MappedFile.inc
index a0dfbbd..148372b 100644
--- a/lib/System/Unix/MappedFile.inc
+++ b/lib/System/Unix/MappedFile.inc
@@ -44,12 +44,12 @@ void MappedFile::initialize() {
throw std::string("Can't open file: ") + path_.toString();
int mode = 0;
- if (options_&READ_ACCESS)
- if (options_&WRITE_ACCESS)
+ if (options_ & READ_ACCESS)
+ if (options_ & WRITE_ACCESS)
mode = O_RDWR;
else
mode = O_RDONLY;
- else if (options_&WRITE_ACCESS)
+ else if (options_ & WRITE_ACCESS)
mode = O_WRONLY;
int FD = ::open(path_.c_str(), mode);
@@ -68,8 +68,7 @@ void MappedFile::initialize() {
void MappedFile::terminate() {
assert(info_ && "MappedFile not initialized");
- if (info_->FD >= 0)
- ::close(info_->FD);
+ ::close(info_->FD);
delete info_;
info_ = 0;
}