Skip to content

Make openFile exception safe

David Feuer requested to merge treeowl/ghc:treeowl-master-patch-21273 into master

Make openFile exception safe

  • openFile could sometimes leak file descriptors if it received an asynchronous exception (#19114 (closed), #19115). Fix this on POSIX.

  • openFile and more importantly openFileBlocking could not be interrupted effectively during the open system call (#17912). Fix this on POSIX.

  • Implement readFile' using withFile to ensure the file is closed promptly on exception.

Addresses #17912, #19114 (closed), and #19115 on POSIX systems, but not on Windows.

Edited by David Feuer

Merge request reports