llvm.org GIT mirror llvm / 4aab4ab
Remove SetWorkingDirectory from the Process interface. Nothing in LLVM or Clang is using this, and it would be hard to use it correctly given the thread hostility of the function. Also, it never checked the return which is rather dangerous with chdir. If someone was in fact using this, please let me know, as well as what the usecase actually is so that I can add it back and make it more correct and secure to use. (That said, it's never going to be "safe" per-se, but we could at least document the risks...) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148211 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 8 years ago
3 changed file(s) with 1 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
137137
138138 /// Resets the terminals colors, or returns an escape sequence to do so.
139139 static const char *ResetColor();
140
141 /// Change the program working directory to that given by \arg Path.
142 static void SetWorkingDirectory(std::string Path);
143140 /// @}
144141 };
145142 }
292292 const char *Process::ResetColor() {
293293 return "\033[0m";
294294 }
295
296 void Process::SetWorkingDirectory(std::string Path) {
297 ::chdir(Path.c_str());
298 }
219219 return 0;
220220 }
221221
222 void Process::SetWorkingDirectory(std::string Path) {
223 ::_chdir(Path.c_str());
224 }
225
226 }
222 }