From 95285a6e5630a0a02a2cc6fe9feb49e71038bed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 17 Feb 2019 15:51:49 +0100 Subject: Use socklen_t directly, instead of deprecated ksize_t. This resolves FTBFS on FreeBSD 12. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ktalkd/ktalkd/machines/CMakeLists.txt | 2 -- ktalkd/ktalkd/machines/talkconn.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'ktalkd') diff --git a/ktalkd/ktalkd/machines/CMakeLists.txt b/ktalkd/ktalkd/machines/CMakeLists.txt index 43da0e27..ae412bc8 100644 --- a/ktalkd/ktalkd/machines/CMakeLists.txt +++ b/ktalkd/ktalkd/machines/CMakeLists.txt @@ -9,8 +9,6 @@ # ################################################# -add_definitions( -Dksize_t=socklen_t ) - include_directories( ${CMAKE_BINARY_DIR} ${TQT_INCLUDE_DIRS} diff --git a/ktalkd/ktalkd/machines/talkconn.cpp b/ktalkd/ktalkd/machines/talkconn.cpp index a7ae93aa..3d80d809 100644 --- a/ktalkd/ktalkd/machines/talkconn.cpp +++ b/ktalkd/ktalkd/machines/talkconn.cpp @@ -128,7 +128,7 @@ int TalkConnection::open_socket (struct sockaddr_in *addr, int type) if (newSocket <= 0) p_error ("Unable to open a new socket!"); - ksize_t length = sizeof (*addr); + socklen_t length = sizeof (*addr); if (bind (newSocket, (struct sockaddr *) addr, length) != 0) { ::close (newSocket); p_error ("Error binding socket!"); @@ -185,7 +185,7 @@ struct in_addr TalkConnection::getReplyAddr (struct in_addr destination) { // by getsockname to the local machine address used to reach the daemon. // If it doesn't work (e.g. on SunOS and Solaris), the default machine // address is used instead. - ksize_t length = sizeof (daemon); + socklen_t length = sizeof (daemon); if ((testsock = socket (AF_INET, SOCK_DGRAM, 0)) >= 0 && bind (testsock, (struct sockaddr *) &client, sizeof (client)) == 0 && ::connect (testsock, (struct sockaddr *) &daemon, -- cgit v1.2.1