mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Eliminate temporary string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -134,15 +134,15 @@ static bool RedirectIO_PS(const Path *Path, int FD, std::string *ErrMsg,
|
|||||||
posix_spawn_file_actions_t &FileActions) {
|
posix_spawn_file_actions_t &FileActions) {
|
||||||
if (Path == 0) // Noop
|
if (Path == 0) // Noop
|
||||||
return false;
|
return false;
|
||||||
std::string File;
|
const char *File;
|
||||||
if (Path->isEmpty())
|
if (Path->isEmpty())
|
||||||
// Redirect empty paths to /dev/null
|
// Redirect empty paths to /dev/null
|
||||||
File = "/dev/null";
|
File = "/dev/null";
|
||||||
else
|
else
|
||||||
File = Path->str();
|
File = Path->c_str();
|
||||||
|
|
||||||
if (int Err = posix_spawn_file_actions_addopen(&FileActions, FD,
|
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 MakeErrMsg(ErrMsg, "Cannot dup2", Err);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user