Avoid side effects due to stale errno value
ClosedPublic

Authored by bruns on Feb 10 2019, 3:49 PM.

Details

Summary

UserMetaData::hasAttribute and isSupported use errno to check if the
syscall was successful. This is insufficient, as a succesful syscall
(return value >= 0) does not reset the errno value.

Also do some minor optimization, there is no need to actually fetch
the value for hasAttribute/isSupported.

Test Plan

run usermetadatawritertest
old code fails for added test

Diff Detail

Repository
R286 KFileMetaData
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Feb 10 2019, 3:49 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptFeb 10 2019, 3:49 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Feb 10 2019, 3:49 PM
astippich accepted this revision.Feb 10 2019, 6:50 PM
This revision is now accepted and ready to land.Feb 10 2019, 6:50 PM
This revision was automatically updated to reflect the committed changes.