[Lldb-commits] [PATCH] D69320: [lldb] [Python] Do not attempt to flush() a read-only fd

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 24 11:32:25 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG267cc3292ec4: [lldb] [Python] Do not attempt to flush() a read-only fd (authored by mgorny, committed by labath).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69320/new/

https://reviews.llvm.org/D69320

Files:
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp


Index: lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1385,11 +1385,13 @@
   if (!options)
     return options.takeError();
 
-  // LLDB and python will not share I/O buffers.  We should probably
-  // flush the python buffers now.
-  auto r = CallMethod("flush");
-  if (!r)
-    return r.takeError();
+  if (options.get() & File::eOpenOptionWrite) {
+    // LLDB and python will not share I/O buffers.  We should probably
+    // flush the python buffers now.
+    auto r = CallMethod("flush");
+    if (!r)
+      return r.takeError();
+  }
 
   FileSP file_sp;
   if (borrowed) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69320.226306.patch
Type: text/x-patch
Size: 818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191024/06eb4fa5/attachment.bin>


More information about the lldb-commits mailing list