Merge pull request #508 from xiaosuo/close
Don't call close(2) more than once
This commit is contained in:
commit
445af7ef7e
@ -374,7 +374,7 @@ struct FileDescriptor {
|
||||
explicit FileDescriptor(int fd) : fd_(fd) {}
|
||||
~FileDescriptor() {
|
||||
if (fd_ >= 0) {
|
||||
NO_INTR(close(fd_));
|
||||
close(fd_);
|
||||
}
|
||||
}
|
||||
int get() { return fd_; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user