Modify setStatusInfoOnDisk to not throw an exception.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29402 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-07-28 22:36:17 +00:00
parent 7dea1019c1
commit 1bebfb5ae4
3 changed files with 15 additions and 14 deletions

View File

@@ -647,15 +647,15 @@ Path::renamePathOnDisk(const Path& newName) {
}
bool
Path::setStatusInfoOnDisk(const FileStatus &si) const {
Path::setStatusInfoOnDisk(const FileStatus &si, std::string *ErrStr) const {
struct utimbuf utb;
utb.actime = si.modTime.toPosixTime();
utb.modtime = utb.actime;
if (0 != ::utime(path.c_str(),&utb))
ThrowErrno(path + ": can't set file modification time");
return GetErrno(path + ": can't set file modification time", ErrStr);
if (0 != ::chmod(path.c_str(),si.mode))
ThrowErrno(path + ": can't set mode");
return true;
return GetErrno(path + ": can't set mode", ErrStr);
return false;
}
void