os: xtrans: drop ifdefs on NAMEDNODENAME

It's always defined, so no ifdefs needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-06-26 16:58:55 +02:00
parent 053f43e6ae
commit cbcb9718ef

View File

@ -210,7 +210,6 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr,
/* NAMED */ /* NAMED */
#ifdef NAMEDNODENAME
static int static int
TRANS(NAMEDOpenPipe)(const char *server_path) TRANS(NAMEDOpenPipe)(const char *server_path)
{ {
@ -270,22 +269,15 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
return(pipefd[1]); return(pipefd[1]);
} }
#endif
static int static int
TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, const char *port) TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, const char *port)
{ {
#ifdef NAMEDNODENAME
int fd; int fd;
char server_path[64]; char server_path[64];
#endif
prmsg(2,"NAMEDOpenServer(%s)\n", port); prmsg(2,"NAMEDOpenServer(%s)\n", port);
#if !defined(NAMEDNODENAME)
prmsg(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n");
return -1;
#else
if ( port && *port ) { if ( port && *port ) {
if( *port == '/' ) { /* A full pathname */ if( *port == '/' ) { /* A full pathname */
(void) snprintf(server_path, sizeof(server_path), "%s", port); (void) snprintf(server_path, sizeof(server_path), "%s", port);
@ -315,8 +307,6 @@ TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, const char *port)
} }
return fd; return fd;
#endif /* !NAMEDNODENAME */
} }
static int static int
@ -401,16 +391,10 @@ static int
TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, const char *port) TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, const char *port)
{ {
#ifdef NAMEDNODENAME
char server_path[64]; char server_path[64];
#endif
prmsg(2,"NAMEDReopenServer(%s)\n", port); prmsg(2,"NAMEDReopenServer(%s)\n", port);
#if !defined(NAMEDNODENAME)
prmsg(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n");
return 0;
#else
if ( port && *port ) { if ( port && *port ) {
if( *port == '/' ) { /* A full pathname */ if( *port == '/' ) { /* A full pathname */
snprintf(server_path, sizeof(server_path),"%s", port); snprintf(server_path, sizeof(server_path),"%s", port);
@ -430,8 +414,6 @@ TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, const char *por
} }
return 1; return 1;
#endif /* !NAMEDNODENAME */
} }
#endif /* LOCAL_TRANS_NAMED */ #endif /* LOCAL_TRANS_NAMED */