Avoid side effects due to stale errno value

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

Description

Avoid side effects due to stale errno value

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

Reviewers: Baloo, Frameworks, ngraham, poboiko, astippich

Reviewed By: astippich

Subscribers: kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D18900

Details

Committed
brunsFeb 10 2019, 11:27 PM
Reviewer
astippich
Differential Revision
D18900: Avoid side effects due to stale errno value
Parents
R286:ce756712695a: Try to fix test on windows
Branches
Unknown
Tags
Unknown