summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar David Majnemer <majnemer@google.com>2022-07-22 09:24:08 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-07-22 09:25:04 -0700
commitc1deed2f4444936b7edb3a4357d89d7e2900f594 (patch)
tree037d013629304ec8d7689ec1d114967f57d38c0f
parent2c489bb5f0b1208da6dc035b07a30f0f67915b23 (diff)
Do not re-close files on EINTR
POSIX is unclear what state a file descriptor is in after a signal is delivered in the middle of close. On Linux, the file is closed even if it returns -1 with errno=EINTR. As such, do not use errno at all when closing files. PiperOrigin-RevId: 462638735 Change-Id: Ie73da1f3c83b1099bef146e1ea32e9a4818597cf
-rw-r--r--absl/debugging/symbolize_elf.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/debugging/symbolize_elf.inc b/absl/debugging/symbolize_elf.inc
index fa401ae8..276d4ae4 100644
--- a/absl/debugging/symbolize_elf.inc
+++ b/absl/debugging/symbolize_elf.inc
@@ -841,7 +841,7 @@ class FileDescriptor {
~FileDescriptor() {
if (fd_ >= 0) {
- NO_INTR(close(fd_));
+ close(fd_);
}
}
@@ -1118,7 +1118,7 @@ void Symbolizer::ClearAddrMap() {
ObjFile *o = addr_map_.At(i);
base_internal::LowLevelAlloc::Free(o->filename);
if (o->fd >= 0) {
- NO_INTR(close(o->fd));
+ close(o->fd);
}
}
addr_map_.Clear();