summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-03-06 04:01:04 +0000
committerGreg Clayton <gclayton@apple.com>2012-03-06 04:01:04 +0000
commit9845a8d54db4f9d8d53853cc1c9a47236b18070a (patch)
tree468ee8de094f4428139aa15690caef310c3ce3d8 /lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
parent97f7e8189149390ea4eb3daa46fac132dbb5183e (diff)
downloadbcm5719-llvm-9845a8d54db4f9d8d53853cc1c9a47236b18070a.tar.gz
bcm5719-llvm-9845a8d54db4f9d8d53853cc1c9a47236b18070a.zip
<rdar://problem/10840355>
Fixed STDERR to not be opened as readable. Also cleaned up some of the code that implemented the file actions as some of the code was using the wrong variables, they now use the right ones (in for stdin, out for stdout, err for stderr). llvm-svn: 152102
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX/MachProcess.cpp')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachProcess.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
index d0d4c8d09be..40e25850b95 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.cpp
@@ -1723,7 +1723,7 @@ MachProcess::PosixSpawnChildForPTraceDebugging
err.LogThreaded ("::posix_spawn_file_actions_addopen (&file_actions, filedes=STDOUT_FILENO, path=/dev/null)");
err.SetError( ::posix_spawn_file_actions_addopen (&file_actions, STDERR_FILENO, "/dev/null",
- O_RDWR | O_NOCTTY, 0), DNBError::POSIX);
+ O_WRONLY | O_NOCTTY, 0), DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit (LOG_PROCESS))
err.LogThreaded ("::posix_spawn_file_actions_addopen (&file_actions, filedes=STDERR_FILENO, path=/dev/null)");
}
@@ -1733,9 +1733,9 @@ MachProcess::PosixSpawnChildForPTraceDebugging
if (stdout_path == NULL) stdout_path = "/dev/null";
if (stderr_path == NULL) stderr_path = "/dev/null";
- int slave_fd_err = open (stderr_path, O_NOCTTY | O_CREAT | O_RDWR , 0640);
- int slave_fd_in = open (stdin_path , O_NOCTTY | O_RDONLY);
- int slave_fd_out = open (stdout_path, O_NOCTTY | O_CREAT | O_WRONLY , 0640);
+ const int slave_fd_in = open (stdin_path , O_NOCTTY | O_RDONLY);
+ const int slave_fd_out = open (stdout_path, O_NOCTTY | O_CREAT | O_WRONLY , 0640);
+ const int slave_fd_err = open (stderr_path, O_NOCTTY | O_CREAT | O_WRONLY , 0640);
err.SetError( ::posix_spawn_file_actions_adddup2(&file_actions, slave_fd_err, STDERR_FILENO), DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
OpenPOWER on IntegriCloud