[llvm] Support: don't block signals around close if it can be avoided (PR #73009)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 30 09:44:19 PST 2023


================
@@ -234,6 +234,25 @@ std::error_code Process::FixupStandardFileDescriptors() {
   return std::error_code();
 }
 
+// Close a file descriptor while being mindful of EINTR.
+//
+// On Unix systems closing a file descriptor usually starts with removing it
+// from the fd table (or an equivalent structure). This means any error
+// generated past that point will still result in the entry being cleared.
+//
+// Make sure to not bubble up EINTR as there is nothing to do in that case.
+// XXX what about other errors?
----------------
arichardson wrote:

This comment should probably explain that signals do not neees to be blocked on these systems and that therefore EINTR can be ignored (is it even possible to get eintr?)

https://github.com/llvm/llvm-project/pull/73009


More information about the llvm-commits mailing list