IOS/FS: Skip writing FST if SetMetadata() changes nothing.
This commit is contained in:
parent
4f96d2f1c3
commit
0d39c4a78a
|
@ -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)
|
if (entry->data.uid != uid && entry->data.is_file && !is_empty)
|
||||||
return ResultCode::FileNotEmpty;
|
return ResultCode::FileNotEmpty;
|
||||||
|
|
||||||
|
if (entry->data.gid != gid || entry->data.uid != uid || entry->data.attribute != attr ||
|
||||||
|
entry->data.modes != modes)
|
||||||
|
{
|
||||||
entry->data.gid = gid;
|
entry->data.gid = gid;
|
||||||
entry->data.uid = uid;
|
entry->data.uid = uid;
|
||||||
entry->data.attribute = attr;
|
entry->data.attribute = attr;
|
||||||
entry->data.modes = modes;
|
entry->data.modes = modes;
|
||||||
SaveFst();
|
SaveFst();
|
||||||
|
}
|
||||||
|
|
||||||
return ResultCode::Success;
|
return ResultCode::Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue