Support/Program: Make Change<stream>ToBinary return error_code.
[oota-llvm.git] / lib / Support / Unix / Path.inc
index 430cf2ed8e8f6ea90dcd871dcd4c07d3a298cc39..418dc0733499d56fd0af10adc21c65b0a695378f 100644 (file)
@@ -234,11 +234,6 @@ Path::GetBitcodeLibraryPaths(std::vector<sys::Path>& Paths) {
   GetSystemLibraryPaths(Paths);
 }
 
-Path
-Path::GetLLVMDefaultConfigDir() {
-  return Path("/etc/llvm/");
-}
-
 Path
 Path::GetUserHomeDirectory() {
   const char* home = getenv("HOME");
@@ -252,8 +247,8 @@ Path::GetUserHomeDirectory() {
 Path
 Path::GetCurrentDirectory() {
   char pathname[MAXPATHLEN];
-  if (!getcwd(pathname,MAXPATHLEN)) {
-    assert (false && "Could not query current working directory.");
+  if (!getcwd(pathname, MAXPATHLEN)) {
+    assert(false && "Could not query current working directory.");
     return Path();
   }
 
@@ -842,6 +837,9 @@ Path::makeUnique(bool reuse_current, std::string* ErrMsg) {
 
   // Save the name
   path = FNBuffer;
+
+  // By default mkstemp sets the mode to 0600, so update mode bits now.
+  AddPermissionBits (*this, 0666);
 #elif defined(HAVE_MKTEMP)
   // If we don't have mkstemp, use the old and obsolete mktemp function.
   if (mktemp(FNBuffer) == 0)