Skip to content

Commit

Permalink
Pass NULL-terminated buffer to pthread_chdir_np
Browse files Browse the repository at this point in the history
  • Loading branch information
jakepetroules committed Nov 14, 2018
1 parent 8bc9b33 commit 40c302a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Basic/Subprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ void llbuild::basic::spawnProcess(
}
} else {
if (threadWorkingDir != attr.workingDir) {
if (pthread_chdir_np(attr.workingDir.data()) == -1) {
const auto workingDir = attr.workingDir.str();
if (pthread_chdir_np(workingDir.c_str()) == -1) {
result = errno;
} else {
threadWorkingDir = attr.workingDir;
Expand Down

0 comments on commit 40c302a

Please sign in to comment.