[Lldb-commits] [PATCH] Use CloseOnExec in Platform::PutFile

Pavel Labath labath at google.com
Tue Feb 17 01:31:58 PST 2015


Hi clayborg,

This does not fix any outstanding issue that I know of, but there is no reason these files should
_not_ have CloseOnExec.

http://reviews.llvm.org/D7694

Files:
  source/Target/Platform.cpp

Index: source/Target/Platform.cpp
===================================================================
--- source/Target/Platform.cpp
+++ source/Target/Platform.cpp
@@ -1351,7 +1351,7 @@
     if (log)
         log->Printf("[PutFile] Using block by block transfer....\n");
 
-    uint32_t source_open_options = File::eOpenOptionRead;
+    uint32_t source_open_options = File::eOpenOptionRead | File::eOpenOptionCloseOnExec;
     if (source.GetFileType() == FileSpec::eFileTypeSymbolicLink)
         source_open_options |= File::eOpenoptionDontFollowSymlinks;
 
@@ -1366,7 +1366,8 @@
     lldb::user_id_t dest_file = OpenFile (destination,
                                           File::eOpenOptionCanCreate |
                                           File::eOpenOptionWrite |
-                                          File::eOpenOptionTruncate,
+                                          File::eOpenOptionTruncate |
+                                          File::eOpenOptionCloseOnExec,
                                           permissions,
                                           error);
     if (log)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7694.20070.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150217/3932bd6c/attachment.bin>


More information about the lldb-commits mailing list