diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-04-18 09:19:41 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-04-18 09:19:41 +0000 |
commit | 5b4be748cb992dc65296548f540b953d95420355 (patch) | |
tree | dfd5d1b3c8c1675f27c9dcb981fdbec56b70995d /llvm/lib/System/Unix | |
parent | 1360e9e270bcabb75551b7f5d9161493a66cfcaa (diff) | |
download | bcm5719-llvm-5b4be748cb992dc65296548f540b953d95420355.tar.gz bcm5719-llvm-5b4be748cb992dc65296548f540b953d95420355.zip |
Eliminate temporary string.
llvm-svn: 101711
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r-- | llvm/lib/System/Unix/Program.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index b7b4e9eb469..6b5dc233aa3 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -134,15 +134,15 @@ static bool RedirectIO_PS(const Path *Path, int FD, std::string *ErrMsg, posix_spawn_file_actions_t &FileActions) { if (Path == 0) // Noop return false; - std::string File; + const char *File; if (Path->isEmpty()) // Redirect empty paths to /dev/null File = "/dev/null"; else - File = Path->str(); - + File = Path->c_str(); + if (int Err = posix_spawn_file_actions_addopen(&FileActions, FD, - File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666)) + File, FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666)) return MakeErrMsg(ErrMsg, "Cannot dup2", Err); return false; } |