From 006a0b8dadaa7c0ed595b26b953d76179720bd6d Mon Sep 17 00:00:00 2001 From: Tim Creech Date: Thu, 12 Sep 2013 20:49:32 +0200 Subject: [PATCH] Didn't build on FreeBSD because it does not define SOL_TCP Replaced SOL_TCP with getprotobyname("TCP")->p_proto BUG: 324766 --- kded/devicelinks/landevicelink.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kded/devicelinks/landevicelink.cpp b/kded/devicelinks/landevicelink.cpp index 38fa110dc..c10d599fe 100644 --- a/kded/devicelinks/landevicelink.cpp +++ b/kded/devicelinks/landevicelink.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "linkproviders/linkprovider.h" #include "networkpackage.h" @@ -40,10 +41,10 @@ LanDeviceLink::LanDeviceLink(const QString& d, LinkProvider* a, QTcpSocket* sock setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &maxIdle, sizeof(maxIdle)); int count = 3; // send up to 3 keepalive packets out, then disconnect if no response - setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &count, sizeof(count)); + setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPCNT, &count, sizeof(count)); int interval = 5; // send a keepalive packet out every 2 seconds (after the 5 second idle period) - setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &interval, sizeof(interval)); + setsockopt(fd, getprotobyname("TCP")->p_proto, TCP_KEEPINTVL, &interval, sizeof(interval)); connect(mSocket, SIGNAL(disconnected()), this, SLOT(deleteLater()));