From 25d57fccd5c9760e04fe5aa3fae0aebd23ee2ad0 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 24 Aug 2018 17:55:51 +0300
Subject: Fix build on Haiku


diff --git a/cmake/modules/FindLibSSH.cmake b/cmake/modules/FindLibSSH.cmake
index d9577ea..dc8bd53 100644
--- a/cmake/modules/FindLibSSH.cmake
+++ b/cmake/modules/FindLibSSH.cmake
@@ -20,6 +20,7 @@ find_path(LIBSSH_INCLUDE_DIR
     /usr/local/include
     /opt/local/include
     /sw/include
+	/system/develop/headers
     ${CMAKE_INCLUDE_PATH}
     ${CMAKE_INSTALL_PREFIX}/include
 )
@@ -33,6 +34,7 @@ find_library(SSH_LIBRARY
     /usr/local/lib
     /opt/local/lib
     /sw/lib
+	/system/develop/lib
     ${CMAKE_LIBRARY_PATH}
     ${CMAKE_INSTALL_PREFIX}/lib
 )
diff --git a/vnc/CMakeLists.txt b/vnc/CMakeLists.txt
index f76fdf3..e75f284 100644
--- a/vnc/CMakeLists.txt
+++ b/vnc/CMakeLists.txt
@@ -36,6 +36,10 @@ if(LIBVNCSERVER_FOUND)
         krdccore
     )
 
+       if(HAIKU)
+               target_link_libraries(krdc_vncplugin network)
+       endif ()
+
     if(JPEG_FOUND)
         target_link_libraries(krdc_vncplugin ${JPEG_LIBRARIES})
     endif(JPEG_FOUND)
diff --git a/vnc/vncclientthread.cpp b/vnc/vncclientthread.cpp
index 39c0342..3d0e06f 100644
--- a/vnc/vncclientthread.cpp
+++ b/vnc/vncclientthread.cpp
@@ -603,7 +603,7 @@ void VncClientThread::clientSetKeepalive()
     }
 
     optval = m_keepalive.intervalSeconds;
-    if (setsockopt(cl->sock, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
+/*    if (setsockopt(cl->sock, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
         qCritical(KRDC) << "setsockopt(TCP_KEEPIDLE)" << strerror(errno);
         return;
     }
@@ -619,7 +619,7 @@ void VncClientThread::clientSetKeepalive()
         qCritical(KRDC) << "setsockopt(TCP_KEEPCNT)" << strerror(errno);
         return;
     }
-    m_keepalive.set = true;
+*/    m_keepalive.set = true;
     qCDebug(KRDC) << "TCP keepalive set";
 }
 
-- 
2.16.4

