From a35e612c553f2dc600333b972b0fee6d20c25baa Mon Sep 17 00:00:00 2001 From: Changli Gao Date: Sat, 21 Dec 2019 23:24:28 +0800 Subject: [PATCH] Don't call close(2) more than once Don't call close(2) more then once, even though close(2) returns -1. See the manual page for details. --- src/symbolize.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/symbolize.cc b/src/symbolize.cc index 191ef38..459091c 100644 --- a/src/symbolize.cc +++ b/src/symbolize.cc @@ -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_; }