[llvm-commits] CVS: llvm/tools/gccld/gccld.cpp

John Criswell criswell at cs.uiuc.edu
Tue Sep 2 15:18:02 PDT 2003


Changes in directory llvm/tools/gccld:

gccld.cpp updated: 1.42 -> 1.43

---
Log message:

Modified the code so that it uses the MakeFileExecutable() method.  The new
library code now adds all execute bits that are allowed by the umask value to
the file's current permission bits.



---
Diffs of the changes:

Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.42 llvm/tools/gccld/gccld.cpp:1.43
--- llvm/tools/gccld/gccld.cpp:1.42	Fri Aug 29 09:46:12 2003
+++ llvm/tools/gccld/gccld.cpp	Tue Sep  2 15:17:20 2003
@@ -21,6 +21,7 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/Scalar.h"
+#include "Support/FileUtilities.h"
 #include "Support/CommandLine.h"
 #include "Support/Signals.h"
 #include <fstream>
@@ -433,9 +434,6 @@
   Out.close();
 
   if (!LinkAsLibrary) {
-    // Permissions masking value of the user
-    mode_t mask;
-
     // Output the script to start the program...
     std::ofstream Out2(OutputFilename.c_str());
     if (!Out2.good())
@@ -444,22 +442,11 @@
     Out2 << "#!/bin/sh\nlli -q -abort-on-exception $0.bc $*\n";
     Out2.close();
   
-    //
-    // Grab the umask value from the operating system.  We want to use it when
-    // changing the file's permissions.
-    //
-    // Note:
-    //  Umask() is one of those annoying system calls.  You have to call it
-    //  to get the current value and then set it back.
-    //
-    mask = umask (0);
-    umask (mask);
-
     // Make the script executable...
-    chmod(OutputFilename.c_str(), (0755 & ~mask));
+    MakeFileExecutable (OutputFilename);
 
     // Make the bytecode file directly executable in LLEE as well
-    chmod(RealBytecodeOutput.c_str(), (0755 & ~mask));
+    MakeFileExecutable (RealBytecodeOutput);
   }
 
   return 0;





More information about the llvm-commits mailing list