D6709: [RFC] Add support for sharing file descriptor between KIO slave and KAuth helper

Thiago Macieira noreply at phabricator.kde.org
Sat Jul 15 16:57:09 UTC 2017


thiago added a comment.


  This class isn't hooked up to anything. It's technically correct as an FD sender and receiver. What I want to see is how you use it, because that's extremely important to get right.
  
  I can confirm to you that anonymous namespace sockets do not work on BSDs (which include macOS).

INLINE COMMENTS

> sharefd.cpp:112
> +
> +    m_socketDes = ::socket(AF_LOCAL, SOCK_STREAM, 0);
> +    if (m_socketDes == -1)

If SOCK_NONBLOCK is defined, OR it o SOCK_STREAM and then you don't have call setNonBlocking below.

> sharefd.cpp:117
> +    KSockaddrUn addr(path);
> +    bool binded = bind(m_socketDes, addr.address(), addr.length()) != -1;
> +    bool listening = listen(m_socketDes, 5) != -1;

"binded" is not English. You mean "bound".

> sharefd.h:33
> +
> +    bool startListening(const std::string &path);
> +    int fileDescriptor() const;

Use QString, not std::string.

REPOSITORY
  R241 KIO

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

To: chinmoyr, thiago, #frameworks
Cc: davidedmundson, elvisangelaccio, shortstheory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170715/95da2321/attachment.html>


More information about the Kde-frameworks-devel mailing list