net/Socket.hpp |   19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 753b0a8e91c65abc4ffbc8e0d3fd484e68b5b6de
Author:     Gabriel Masei <gabriel.ma...@1and1.ro>
AuthorDate: Tue Apr 28 23:45:26 2020 +0300
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Wed Apr 29 14:45:19 2020 +0200

    let the higher levels to process the recvmsg return value
    
    Change-Id: I41c089229095739f38f40dbd0fb7c1d4c82efd41
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93110
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Tested-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/net/Socket.hpp b/net/Socket.hpp
index 34da98aab..37e289a63 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -1178,25 +1178,18 @@ protected:
         msg.msg_flags = 0;
 
         int ret = recvmsg(getFD(), &msg, 0);
-        if (ret >= 0)
+        if (ret > 0 && msg.msg_controllen)
         {
-            if (msg.msg_controllen)
+            cmsghdr *cmsg = CMSG_FIRSTHDR(&msg);
+            if (cmsg && cmsg->cmsg_type == SCM_RIGHTS && cmsg->cmsg_len == 
CMSG_LEN(sizeof(int)))
             {
-                cmsghdr *cmsg = CMSG_FIRSTHDR(&msg);
-                if (cmsg && cmsg->cmsg_type == SCM_RIGHTS && cmsg->cmsg_len == 
CMSG_LEN(sizeof(int)))
+                fd = *(int*)CMSG_DATA(cmsg);
+                if (_readType == UseRecvmsgExpectFD)
                 {
-                    fd = *(int*)CMSG_DATA(cmsg);
-                    if (_readType == UseRecvmsgExpectFD)
-                    {
-                        _readType = NormalRead;
-                    }
+                    _readType = NormalRead;
                 }
             }
         }
-        else
-        {
-            LOG_ERR("recvmsg call ended with error: " << errno);
-        }
 
         return ret;
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to