[llvm-commits] [llvm] r101711 - /llvm/trunk/lib/System/Unix/Program.inc
Benjamin Kramer
benny.kra at googlemail.com
Sun Apr 18 02:19:41 PDT 2010
Author: d0k
Date: Sun Apr 18 04:19:41 2010
New Revision: 101711
URL: http://llvm.org/viewvc/llvm-project?rev=101711&view=rev
Log:
Eliminate temporary string.
Modified:
llvm/trunk/lib/System/Unix/Program.inc
Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=101711&r1=101710&r2=101711&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Sun Apr 18 04:19:41 2010
@@ -134,15 +134,15 @@
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;
}
More information about the llvm-commits
mailing list