]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Some platforms actually have an unsigned msghdr.msg_iovlen even 9979/head
authorOtto <otto.moerbeek@open-xchange.com>
Fri, 15 Jan 2021 14:59:06 +0000 (15:59 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Fri, 15 Jan 2021 15:03:46 +0000 (16:03 +0100)
though Posix says it should be an int.

So use the power of C++ to make the var the same type as msghdr.msg_iovlen.

pdns/calidns.cc

index df9307798173039b71350273c9ed61dfa7e0156e..e8dac6eb6d922ac9d8b3ea31ac31adfd4f41b089 100644 (file)
@@ -108,7 +108,7 @@ static void* recvThread(const vector<std::unique_ptr<Socket>>* sockets)
           continue;
         }
         g_recvcounter++;
-        for (int i = 0; i < buf.msg_iovlen; i++)
+        for (decltype(buf.msg_iovlen) i = 0; i < buf.msg_iovlen; i++)
           g_recvbytes += buf.msg_iov[i].iov_len;
 #endif
       }