diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-02-17 15:51:49 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-02-17 15:52:05 +0100 |
commit | 2d0d6df1dc0ec33b2e91196eccf79e78a8162440 (patch) | |
tree | 1bca24c0c61d52816ae41d487f8e83b6f2ae9b41 | |
parent | 686de3c7b7255af6b1a8543e7ff7c5d1aaabb87b (diff) | |
download | tdenetwork-2d0d6df1dc0ec33b2e91196eccf79e78a8162440.tar.gz tdenetwork-2d0d6df1dc0ec33b2e91196eccf79e78a8162440.zip |
Use socklen_t directly, instead of deprecated ksize_t.
This resolves FTBFS on FreeBSD 12.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 95285a6e5630a0a02a2cc6fe9feb49e71038bed7)
-rw-r--r-- | ksirc/puke/controller.cpp | 2 | ||||
-rw-r--r-- | ktalkd/ktalkd/machines/CMakeLists.txt | 2 | ||||
-rw-r--r-- | ktalkd/ktalkd/machines/talkconn.cpp | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/ksirc/puke/controller.cpp b/ksirc/puke/controller.cpp index bbcf6de6..06d290fb 100644 --- a/ksirc/puke/controller.cpp +++ b/ksirc/puke/controller.cpp @@ -162,7 +162,7 @@ TQStrList PukeController::allObjects() void PukeController::NewConnect(int) { int cfd; - ksize_t len = 0; + socklen_t len = 0; struct sockaddr_un unix_addr; cfd = accept(iListenFd, (struct sockaddr *)&unix_addr, &len); 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, |