Remove SetWorkingDirectory from the Process interface. Nothing in LLVM
authorChandler Carruth <chandlerc@gmail.com>
Sun, 15 Jan 2012 08:41:35 +0000 (08:41 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 15 Jan 2012 08:41:35 +0000 (08:41 +0000)
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

include/llvm/Support/Process.h
lib/Support/Unix/Process.inc
lib/Support/Windows/Process.inc

index 27ef2670093a301fbdd6c2340d31f05173af57c2..33799229ff3576156ddf4978f9576a0b5102e09b 100644 (file)
@@ -138,9 +138,6 @@ namespace sys {
 
       /// Resets the terminals colors, or returns an escape sequence to do so.
       static const char *ResetColor();
-
-      /// Change the program working directory to that given by \arg Path.
-      static void SetWorkingDirectory(std::string Path);
     /// @}
   };
 }
index da440fd48f3d60921a354b238cbfee061a8f019e..5cdb11ccebc445de222e6f1ea67b9a3b8b254837 100644 (file)
@@ -293,7 +293,3 @@ const char *Process::OutputBold(bool bg) {
 const char *Process::ResetColor() {
   return "\033[0m";
 }
-
-void Process::SetWorkingDirectory(std::string Path) {
-  ::chdir(Path.c_str());
-}
index fe54eb1a7972d01a9c07475b4caa4cae60561169..913b0734ddc9b21bf9afaf17ab23fd949cb9844c 100644 (file)
@@ -220,8 +220,4 @@ const char *Process::ResetColor() {
   return 0;
 }
 
-void Process::SetWorkingDirectory(std::string Path) {
-  ::_chdir(Path.c_str());
-}
-
 }