Merge pull request #508 from xiaosuo/close

Don't call close(2) more than once
This commit is contained in:
Shinichiro Hamaji 2019-12-24 11:38:26 +09:00 committed by GitHub
commit 445af7ef7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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_; }