fjricci updated this revision to Diff 51005.
fjricci added a comment.

Always use write flag, even in append mode


http://reviews.llvm.org/D18228

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

Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===================================================================
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1252,10 +1252,10 @@
     return llvm::StringSwitch<uint32_t>(mode.str().c_str())
     .Case("r",   File::eOpenOptionRead)
     .Case("w",   File::eOpenOptionWrite)
-    .Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
+    .Case("a",   
File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
     .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
     .Case("w+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-    .Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+    .Case("a+",  
File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
     .Default(0);
 }
 


Index: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
===================================================================
--- source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1252,10 +1252,10 @@
     return llvm::StringSwitch<uint32_t>(mode.str().c_str())
     .Case("r",   File::eOpenOptionRead)
     .Case("w",   File::eOpenOptionWrite)
-    .Case("a",   File::eOpenOptionAppend|File::eOpenOptionCanCreate)
+    .Case("a",   File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
     .Case("r+",  File::eOpenOptionRead|File::eOpenOptionWrite)
     .Case("w+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-    .Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+    .Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionAppend|File::eOpenOptionCanCreate)
     .Default(0);
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to