D18900: Avoid side effects due to stale errno value

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sun Feb 10 15:49:17 GMT 2019


bruns created this revision.
bruns added reviewers: Baloo, Frameworks, ngraham, poboiko, astippich.
Herald added projects: Frameworks, Baloo.
Herald added a subscriber: kde-frameworks-devel.
bruns requested review of this revision.

REVISION 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

REPOSITORY
  R286 KFileMetaData

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D18900

AFFECTED FILES
  autotests/usermetadatawritertest.cpp
  src/xattr_p.h

To: bruns, #baloo, #frameworks, ngraham, poboiko, astippich
Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190210/453bd9b8/attachment.html>


More information about the Kde-frameworks-devel mailing list