mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
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
This commit is contained in:
parent
0af7093532
commit
84bad2f96c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user