summaryrefslogtreecommitdiff
path: root/lib/System
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-04-18 09:19:41 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-04-18 09:19:41 +0000
commitd7aef9b440fa7dfb41a5dfdb9723f1fdee976289 (patch)
tree2a0dfeb917007479b9fcabf6f899c73c3122f2af /lib/System
parentbceaffc7cc1c484a1bb353e1d8ac42d2e8e57f69 (diff)
downloadllvm-d7aef9b440fa7dfb41a5dfdb9723f1fdee976289.tar.gz
llvm-d7aef9b440fa7dfb41a5dfdb9723f1fdee976289.tar.bz2
llvm-d7aef9b440fa7dfb41a5dfdb9723f1fdee976289.tar.xz
Eliminate temporary string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r--lib/System/Unix/Program.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index b7b4e9eb46..6b5dc233aa 100644
--- a/lib/System/Unix/Program.inc
+++ b/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;
}