[llvm] [llvm-exegesis] Close file descriptors after use (PR #86584)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 12:32:26 PDT 2024


================
@@ -317,6 +317,7 @@ class SubProcessFunctionExecutorImpl
     int CounterFileDescriptor = Counter->getFileDescriptor();
     Error SendError =
         sendFileDescriptorThroughSocket(WriteFD, CounterFileDescriptor);
+    close(WriteFD);
----------------
boomanaiden154 wrote:

Good point. I've used it within all of these functions to ensure that the file descriptor is properly closed upon exiting the function (especially with error conditions). Thanks for pointing this out! I hadn't heard about `make_scope_exit` before.

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


More information about the llvm-commits mailing list