Merge pull request #10972 from AdmiralCurtiss/ios-fs-metadata-nop
IOS/FS: Skip writing FST if SetMetadata() changes nothing.
This commit is contained in:
commit
be33e1079d
|
@ -678,11 +678,15 @@ ResultCode HostFileSystem::SetMetadata(Uid caller_uid, const std::string& path,
|
|||
if (entry->data.uid != uid && entry->data.is_file && !is_empty)
|
||||
return ResultCode::FileNotEmpty;
|
||||
|
||||
entry->data.gid = gid;
|
||||
entry->data.uid = uid;
|
||||
entry->data.attribute = attr;
|
||||
entry->data.modes = modes;
|
||||
SaveFst();
|
||||
if (entry->data.gid != gid || entry->data.uid != uid || entry->data.attribute != attr ||
|
||||
entry->data.modes != modes)
|
||||
{
|
||||
entry->data.gid = gid;
|
||||
entry->data.uid = uid;
|
||||
entry->data.attribute = attr;
|
||||
entry->data.modes = modes;
|
||||
SaveFst();
|
||||
}
|
||||
|
||||
return ResultCode::Success;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue