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>
pull/8/head
Slávek Banko 6 years ago
parent 53aff5055e
commit 95285a6e56
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -162,7 +162,7 @@ TQStrList PukeController::allObjects()
void PukeController::NewConnect(int) void PukeController::NewConnect(int)
{ {
int cfd; int cfd;
ksize_t len = 0; socklen_t len = 0;
struct sockaddr_un unix_addr; struct sockaddr_un unix_addr;
cfd = accept(iListenFd, (struct sockaddr *)&unix_addr, &len); cfd = accept(iListenFd, (struct sockaddr *)&unix_addr, &len);

@ -9,8 +9,6 @@
# #
################################################# #################################################
add_definitions( -Dksize_t=socklen_t )
include_directories( include_directories(
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS}

@ -128,7 +128,7 @@ int TalkConnection::open_socket (struct sockaddr_in *addr, int type)
if (newSocket <= 0) if (newSocket <= 0)
p_error ("Unable to open a new socket!"); 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) { if (bind (newSocket, (struct sockaddr *) addr, length) != 0) {
::close (newSocket); ::close (newSocket);
p_error ("Error binding socket!"); 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. // 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 // If it doesn't work (e.g. on SunOS and Solaris), the default machine
// address is used instead. // address is used instead.
ksize_t length = sizeof (daemon); socklen_t length = sizeof (daemon);
if ((testsock = socket (AF_INET, SOCK_DGRAM, 0)) >= 0 && if ((testsock = socket (AF_INET, SOCK_DGRAM, 0)) >= 0 &&
bind (testsock, (struct sockaddr *) &client, sizeof (client)) == 0 && bind (testsock, (struct sockaddr *) &client, sizeof (client)) == 0 &&
::connect (testsock, (struct sockaddr *) &daemon, ::connect (testsock, (struct sockaddr *) &daemon,

Loading…
Cancel
Save