os: drop conditional build on TCPCONN define

This symbol is always defined for aeons, at least since meson transition,
and there doesn't seem any desire to ever switch it off again, so we
can drop the #ifdef's.

Note that the symbol still needs to be defined for xtrans, but doing so
in os/meson.build should be enough.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-04-17 17:33:01 +02:00
parent 94979681c0
commit d6eceee960
8 changed files with 4 additions and 34 deletions

View File

@ -196,7 +196,6 @@ if conf_data.get('HAVE_GETPEEREID').to_int() == 0 and conf_data.get('HAVE_GETPEE
endif endif
endif endif
conf_data.set('TCPCONN', '1')
conf_data.set('UNIXCONN', host_machine.system() != 'windows' ? '1' : false) conf_data.set('UNIXCONN', host_machine.system() != 'windows' ? '1' : false)
conf_data.set('IPv6', build_ipv6 ? '1' : false) conf_data.set('IPv6', build_ipv6 ? '1' : false)

View File

@ -89,9 +89,6 @@
/* Define to 1 on systems derived from System V Release 4 */ /* Define to 1 on systems derived from System V Release 4 */
#mesondefine SVR4 #mesondefine SVR4
/* Support TCP socket connections */
#mesondefine TCPCONN
/* Support UNIX socket connections */ /* Support UNIX socket connections */
#mesondefine UNIXCONN #mesondefine UNIXCONN

View File

@ -105,9 +105,7 @@ SOFTWARE.
#include <pwd.h> #include <pwd.h>
#endif #endif
#if defined(TCPCONN)
#include <netinet/in.h> #include <netinet/in.h>
#endif /* TCPCONN */
#ifdef HAVE_GETPEERUCRED #ifdef HAVE_GETPEERUCRED
#include <ucred.h> #include <ucred.h>
@ -400,9 +398,6 @@ AccessUsingXdmcp(void)
void void
DefineSelf(int fd) DefineSelf(int fd)
{ {
#if !defined(TCPCONN) && !defined(UNIXCONN)
return;
#else
int len; int len;
caddr_t addr; caddr_t addr;
int family; int family;
@ -515,7 +510,6 @@ DefineSelf(int fd)
selfhosts = host; selfhosts = host;
} }
} }
#endif /* !TCPCONN && !UNIXCONN */
} }
#else #else
@ -897,7 +891,7 @@ ResetHosts(const char *display)
char *ptr; char *ptr;
int i, hostlen; int i, hostlen;
#if defined(TCPCONN) && (!defined(IPv6)) #if !defined(IPv6)
union { union {
struct sockaddr sa; struct sockaddr sa;
struct sockaddr_in in; struct sockaddr_in in;
@ -944,7 +938,6 @@ ResetHosts(const char *display)
NewHost(family, "", 0, FALSE); NewHost(family, "", 0, FALSE);
LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */ LocalHostRequested = TRUE; /* Fix for XFree86 bug #156 */
} }
#if defined(TCPCONN)
else if (!strncmp("inet:", lhostname, 5)) { else if (!strncmp("inet:", lhostname, 5)) {
family = FamilyInternet; family = FamilyInternet;
hostname = ohostname + 5; hostname = ohostname + 5;
@ -954,7 +947,6 @@ ResetHosts(const char *display)
family = FamilyInternet6; family = FamilyInternet6;
hostname = ohostname + 6; hostname = ohostname + 6;
} }
#endif
#endif #endif
else if (!strncmp("si:", lhostname, 3)) { else if (!strncmp("si:", lhostname, 3)) {
family = FamilyServerInterpreted; family = FamilyServerInterpreted;
@ -969,7 +961,6 @@ ResetHosts(const char *display)
} }
} }
else else
#if defined(TCPCONN)
{ {
#if defined(IPv6) #if defined(IPv6)
if ((family == FamilyInternet) || (family == FamilyInternet6) || if ((family == FamilyInternet) || (family == FamilyInternet6) ||
@ -1020,7 +1011,6 @@ ResetHosts(const char *display)
} }
#endif /* IPv6 */ #endif /* IPv6 */
} }
#endif /* TCPCONN */
family = FamilyWild; family = FamilyWild;
} }
fclose(fd); fclose(fd);
@ -1442,7 +1432,6 @@ CheckAddr(int family, const void *pAddr, unsigned length)
int len; int len;
switch (family) { switch (family) {
#if defined(TCPCONN)
case FamilyInternet: case FamilyInternet:
if (length == sizeof(struct in_addr)) if (length == sizeof(struct in_addr))
len = length; len = length;
@ -1456,7 +1445,6 @@ CheckAddr(int family, const void *pAddr, unsigned length)
else else
len = -1; len = -1;
break; break;
#endif
#endif #endif
case FamilyServerInterpreted: case FamilyServerInterpreted:
len = siCheckAddr(pAddr, length); len = siCheckAddr(pAddr, length);
@ -1525,7 +1513,6 @@ ConvertAddr(register struct sockaddr *saddr, int *len, void **addr)
case AF_UNIX: case AF_UNIX:
#endif #endif
return FamilyLocal; return FamilyLocal;
#if defined(TCPCONN)
case AF_INET: case AF_INET:
#ifdef WIN32 #ifdef WIN32
if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr) if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr)
@ -1550,7 +1537,6 @@ ConvertAddr(register struct sockaddr *saddr, int *len, void **addr)
return FamilyInternet6; return FamilyInternet6;
} }
} }
#endif
#endif #endif
default: default:
return -1; return -1;

View File

@ -84,7 +84,6 @@ SOFTWARE.
#ifndef WIN32 #ifndef WIN32
#include <sys/socket.h> #include <sys/socket.h>
#if defined(TCPCONN)
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#ifdef CSRG_BASED #ifdef CSRG_BASED
@ -92,9 +91,8 @@ SOFTWARE.
#endif #endif
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#endif
#include <sys/uio.h> #include <sys/uio.h>
#endif /* WIN32 */ #endif /* !WIN32 */
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "os/audit.h" #include "os/audit.h"
@ -391,7 +389,6 @@ AuthAudit(ClientPtr client, Bool letin,
#endif #endif
strlcpy(addr, "local host", sizeof(addr)); strlcpy(addr, "local host", sizeof(addr));
break; break;
#if defined(TCPCONN)
case AF_INET: case AF_INET:
snprintf(addr, sizeof(addr), "IP %s", snprintf(addr, sizeof(addr), "IP %s",
inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr)); inet_ntoa(((struct sockaddr_in *) saddr)->sin_addr));
@ -405,7 +402,6 @@ AuthAudit(ClientPtr client, Bool letin,
snprintf(addr, sizeof(addr), "IP %s", ipaddr); snprintf(addr, sizeof(addr), "IP %s", ipaddr);
} }
break; break;
#endif
#endif #endif
default: default:
strlcpy(addr, "unknown address", sizeof(addr)); strlcpy(addr, "unknown address", sizeof(addr));

View File

@ -94,6 +94,6 @@ libxserver_os = static_library('libxserver_os',
os_dep, os_dep,
dependency('xau') dependency('xau')
], ],
c_args: os_c_args, c_args: [os_c_args, '-DTCPCONN'],
link_with: libxlibc, link_with: libxlibc,
) )

View File

@ -99,11 +99,9 @@ __stdcall unsigned long GetTickCount(void);
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> /* for malloc() */ #include <stdlib.h> /* for malloc() */
#if defined(TCPCONN)
#ifndef WIN32 #ifndef WIN32
#include <netdb.h> #include <netdb.h>
#endif #endif
#endif
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/input_priv.h" #include "dix/input_priv.h"
@ -881,7 +879,6 @@ int
set_font_authorizations(char **authorizations, int *authlen, void *client) set_font_authorizations(char **authorizations, int *authlen, void *client)
{ {
#define AUTHORIZATION_NAME "hp-hostname-1" #define AUTHORIZATION_NAME "hp-hostname-1"
#if defined(TCPCONN)
static char *result = NULL; static char *result = NULL;
static char *p = NULL; static char *p = NULL;
@ -939,9 +936,6 @@ set_font_authorizations(char **authorizations, int *authlen, void *client)
*authlen = p - result; *authlen = p - result;
*authorizations = result; *authorizations = result;
return 1; return 1;
#else /* TCPCONN */
return 0;
#endif /* TCPCONN */
} }
void void

View File

@ -282,7 +282,6 @@ XdmAuthorizationValidate(unsigned char *plain, int length,
if (_XSERVTransGetPeerAddr(((OsCommPtr) xclient->osPrivate)->trans_conn, if (_XSERVTransGetPeerAddr(((OsCommPtr) xclient->osPrivate)->trans_conn,
&family, &addr_len, &addr) == 0 &family, &addr_len, &addr) == 0
&& _XSERVTransConvertAddress(&family, &addr_len, &addr) == 0) { && _XSERVTransConvertAddress(&family, &addr_len, &addr) == 0) {
#if defined(TCPCONN)
if (family == FamilyInternet && if (family == FamilyInternet &&
memcmp((char *) addr, client->client, 4) != 0) { memcmp((char *) addr, client->client, 4) != 0) {
free(client); free(client);
@ -293,7 +292,6 @@ XdmAuthorizationValidate(unsigned char *plain, int length,
return NULL; return NULL;
} }
#endif
free(addr); free(addr);
} }
} }

View File

@ -1408,7 +1408,7 @@ get_addr_by_name(const char *argtype,
#ifdef XTHREADS_NEEDS_BYNAMEPARAMS #ifdef XTHREADS_NEEDS_BYNAMEPARAMS
_Xgethostbynameparams hparams; _Xgethostbynameparams hparams;
#endif #endif
#if defined(WIN32) && defined(TCPCONN) #if defined(WIN32)
_XSERVTransWSAStartup(); _XSERVTransWSAStartup();
#endif #endif
if (!(hep = _XGethostbyname(namestr, hparams))) { if (!(hep = _XGethostbyname(namestr, hparams))) {