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;
|
||||||
|
|
||||||
entry->data.gid = gid;
|
if (entry->data.gid != gid || entry->data.uid != uid || entry->data.attribute != attr ||
|
||||||
entry->data.uid = uid;
|
entry->data.modes != modes)
|
||||||
entry->data.attribute = attr;
|
{
|
||||||
entry->data.modes = modes;
|
entry->data.gid = gid;
|
||||||
SaveFst();
|
entry->data.uid = uid;
|
||||||
|
entry->data.attribute = attr;
|
||||||
|
entry->data.modes = modes;
|
||||||
|
SaveFst();
|
||||||
|
}
|
||||||
|
|
||||||
return ResultCode::Success;
|
return ResultCode::Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue