summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2018-07-10 14:58:58 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2018-07-10 14:58:58 +0000
commit9ac67ea9a5a2de7bbc1f395311e32644db7f5276 (patch)
treee4dc11532e54615950f771840db3a756c2637e0a
parenta23a8fd6a3eb1a06e665d3d552990d25512d23dc (diff)
Remove more unused ifdefs blocks
-rw-r--r--app/xenodm/xenodm/netaddr.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/app/xenodm/xenodm/netaddr.c b/app/xenodm/xenodm/netaddr.c
index ace838d51..0a44d6373 100644
--- a/app/xenodm/xenodm/netaddr.c
+++ b/app/xenodm/xenodm/netaddr.c
@@ -37,16 +37,10 @@ from The Open Group.
#include <X11/X.h> /* FamilyInternet, etc. */
-
# include "dm_socket.h"
# ifdef UNIXCONN
-# ifndef X_NO_SYS_UN
-# include <sys/un.h> /* struct sockaddr_un */
-# endif
-# endif
-# ifdef DNETCONN
-# include <netdnet/dn.h> /* struct sockaddr_dn */
+# include <sys/un.h> /* struct sockaddr_un */
# endif
/* given an XdmcpNetaddr, returns the socket protocol family used,
@@ -54,12 +48,7 @@ from The Open Group.
int NetaddrFamily(XdmcpNetaddr netaddrp)
{
-# ifdef STREAMSCONN
- short family = *(short *)netaddrp;
- return family;
-# else
return ((struct sockaddr *)netaddrp)->sa_family;
-# endif
}
/* given an XdmcpNetaddr, returns a pointer to the network address
@@ -67,17 +56,13 @@ int NetaddrFamily(XdmcpNetaddr netaddrp)
char * NetaddrAddress(XdmcpNetaddr netaddrp, int *lenp)
{
-# ifdef STREAMSCONN
- *lenp = 4;
- return netaddrp+4;
-# else
switch (NetaddrFamily(netaddrp)) {
-# ifdef UNIXCONN
+# ifdef UNIXCONN
case AF_UNIX:
*lenp = strlen(((struct sockaddr_un *)netaddrp)->sun_path);
return (char *) (((struct sockaddr_un *)netaddrp)->sun_path);
-# endif
-# ifdef TCPCONN
+# endif
+# ifdef TCPCONN
case AF_INET:
*lenp = sizeof (struct in_addr);
return (char *) &(((struct sockaddr_in *)netaddrp)->sin_addr);
@@ -92,12 +77,11 @@ char * NetaddrAddress(XdmcpNetaddr netaddrp, int *lenp)
return (char *) &(a->s6_addr);
}
}
-# endif
+# endif
default:
*lenp = 0;
return NULL;
}
-# endif /* STREAMSCONN else */
}
@@ -112,24 +96,15 @@ int ConvertAddr (XdmcpNetaddr saddr, int *len, char **addr)
if ((len == NULL) || (saddr == NULL))
return -1;
*addr = NetaddrAddress(saddr, len);
-# ifdef STREAMSCONN
- /* kludge */
- if (NetaddrFamily(saddr) == 2)
- retval = FamilyInternet;
-# else
switch (NetaddrFamily(saddr))
{
-# ifdef AF_UNSPEC
case AF_UNSPEC:
retval = FamilyLocal;
break;
-# endif
-# ifdef AF_UNIX
case AF_UNIX:
retval = FamilyLocal;
break;
-# endif
-# ifdef TCPCONN
+# ifdef TCPCONN
case AF_INET:
retval = FamilyInternet;
break;
@@ -139,12 +114,11 @@ int ConvertAddr (XdmcpNetaddr saddr, int *len, char **addr)
else
retval = FamilyInternet6;
break;
-# endif
+# endif
default:
retval = -1;
break;
}
-# endif /* STREAMSCONN else */
Debug ("ConvertAddr returning %d for family %d\n", retval,
NetaddrFamily(saddr));
return retval;