Avoid side effects due to stale errno value
ClosedPublic

Authored by bruns on Sun, Feb 10, 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.Sun, Feb 10, 3:49 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptSun, Feb 10, 3:49 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Sun, Feb 10, 3:49 PM
astippich accepted this revision.Sun, Feb 10, 6:50 PM
This revision is now accepted and ready to land.Sun, Feb 10, 6:50 PM
This revision was automatically updated to reflect the committed changes.