================
@@ -378,7 +378,10 @@ Status NativeFile::Close() {
           m_options & (File::eOpenOptionReadOnly | File::eOpenOptionWriteOnly |
                        File::eOpenOptionReadWrite);
 
-      if (rw == eOpenOptionWriteOnly || rw == eOpenOptionReadWrite) {
+      // If the stream is writable, and has not already been closed, flush
+      // it.
+      if ((rw == eOpenOptionWriteOnly || rw == eOpenOptionReadWrite) &&
+          (m_stream->_flags != m_stream->_fileno)) {
----------------
cmtice wrote:

I am not sure; if you have a better suggestion for how to address/fix this 
issue I would be happy to hear it (I am not thrilled with this myself, but 
couldn't find a better way to do this).

https://github.com/llvm/llvm-project/pull/169088
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to