dfaure added inline comments.

INLINE COMMENTS

> ConfigureChecks.cmake:12
>  check_include_files(limits.h      HAVE_LIMITS_H)
> +check_include_files(sys/xattr.h   HAVE_SYS_XATTR_H)
> +check_include_files("sys/types.h;sys/extattr.h" HAVE_SYS_EXTATTR_H)

This is already done by `cmake/FindACL.cmake`, why not add the other one 
(extattr.h) to that file as well?

The CMakeLists.txt in this directory calls `find_package(ACL)` so it'll be used.

Even though this isn't technically about ACLs, I'm guessing it all links 
*because* FindACL.cmake links to libattr, right?
And then this might also mean that the condition in FindACL.cmake needs to be 
updated, it currently *requires* HAVE_SYS_XATTR_H instead of allowing both 
variants.

But then I guess this means kpropertiesdialog.cpp needs to be ported to the 
sys/extattr.h API.

Has this been tested on a system with sys/extattr.h? I'm wondering if what will 
happen is: FindACL didn't find sys/attr.h so it doesn't link to libattr, and 
then the new code here fails to link. Or am I missing something?

> file_unix.cpp:535
> +
> +bool FileProtocol::copyXattrs(const int src_fd, const int dest_fd)
> +{

This whole method should be in `#if HAVE_SYS_XATTR_H || HAVE_SYS_EXTATTR_H`.

Otherwise, on systems with neither defined, a lot of compiler warnings will 
happen, like "keyLen isn't initialized" on line 591.

You can leave the method in the .h without #if (those defines aren't known 
there).
Here you can either #if the method itself (declared and not defined and not 
used, is OK, although some might say, a bit unclean)
or #if the whole method *contents*, but then in the #else you need 
`Q_UNUSED(src_fd); Q_UNUSED(dest_fd);` to avoid compiler warnings about unused 
parameters.

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

To: arrowd, dfaure, chinmoyr, bruns, #frameworks, tmarshall, usta, cochise
Cc: usta, scheirle, tmarshall, arrowd, cfeck, bruns, phidrho, dhaumann, 
funkybomber, abika, pino, davidedmundson, ngraham, atha.kane, spoorun, 
nicolasfella, kde-frameworks-devel, LeGast00n, cblack, michaelh

Reply via email to