mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Added a description of the algorithm.
Return failure if the chmod() fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8326 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -98,12 +98,14 @@ std::string getUniqueFilename(const std::string &FilenameBase) {
|
|||||||
///
|
///
|
||||||
/// Description:
|
/// Description:
|
||||||
/// This method makes the specified filename executable by giving it
|
/// This method makes the specified filename executable by giving it
|
||||||
/// execute permission.
|
/// execute permission. It respects the umask value of the process, and it
|
||||||
|
/// does not enable any unnecessary access bits.
|
||||||
///
|
///
|
||||||
/// For the UNIX version of this method, we turn on all of the read and
|
/// Algorithm:
|
||||||
/// execute bits and then turn off anything specified in the umask. This
|
/// o Get file's current permissions.
|
||||||
/// should help ensure that access to the file remains at the level that
|
/// o Get the process's current umask.
|
||||||
/// the user desires.
|
/// o Take the set of all execute bits and disable those found in the umask.
|
||||||
|
/// o Add the remaining permissions to the file's permissions.
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
MakeFileExecutable (const std::string & Filename)
|
MakeFileExecutable (const std::string & Filename)
|
||||||
@@ -134,8 +136,13 @@ MakeFileExecutable (const std::string & Filename)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the script executable...
|
//
|
||||||
chmod(Filename.c_str(), (fstat.st_mode | (0111 & ~mask)));
|
// Make the file executable...
|
||||||
|
//
|
||||||
|
if ((chmod(Filename.c_str(), (fstat.st_mode | (0111 & ~mask)))) == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -98,12 +98,14 @@ std::string getUniqueFilename(const std::string &FilenameBase) {
|
|||||||
///
|
///
|
||||||
/// Description:
|
/// Description:
|
||||||
/// This method makes the specified filename executable by giving it
|
/// This method makes the specified filename executable by giving it
|
||||||
/// execute permission.
|
/// execute permission. It respects the umask value of the process, and it
|
||||||
|
/// does not enable any unnecessary access bits.
|
||||||
///
|
///
|
||||||
/// For the UNIX version of this method, we turn on all of the read and
|
/// Algorithm:
|
||||||
/// execute bits and then turn off anything specified in the umask. This
|
/// o Get file's current permissions.
|
||||||
/// should help ensure that access to the file remains at the level that
|
/// o Get the process's current umask.
|
||||||
/// the user desires.
|
/// o Take the set of all execute bits and disable those found in the umask.
|
||||||
|
/// o Add the remaining permissions to the file's permissions.
|
||||||
///
|
///
|
||||||
bool
|
bool
|
||||||
MakeFileExecutable (const std::string & Filename)
|
MakeFileExecutable (const std::string & Filename)
|
||||||
@@ -134,8 +136,13 @@ MakeFileExecutable (const std::string & Filename)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the script executable...
|
//
|
||||||
chmod(Filename.c_str(), (fstat.st_mode | (0111 & ~mask)));
|
// Make the file executable...
|
||||||
|
//
|
||||||
|
if ((chmod(Filename.c_str(), (fstat.st_mode | (0111 & ~mask)))) == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user