From 62c9f52e4158d5dc56cf6084f66f06aaeeead4bc Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 31 Aug 2024 17:13:25 -0700 Subject: [PATCH] Remove remnants of support for SVR4 systems other than Solaris & illumos Most of the support for such OS'es was removed in 2010 for xorg-server-1.10.0, but a few bits lingered on. Signed-off-by: Alan Coopersmith Part-of: --- hw/xfree86/os-support/xf86_OSlib.h | 24 +++----------- os/access.c | 51 ++++-------------------------- os/io.c | 9 ++---- 3 files changed, 13 insertions(+), 71 deletions(-) diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index c706f260b..0b8363faf 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/hw/xfree86/os-support/xf86_OSlib.h @@ -81,10 +81,9 @@ #include /**************************************************************************/ -/* SVR4, including Solaris */ +/* Solaris or illumos-based system */ /**************************************************************************/ -#if (defined(SVR4)) && \ - (defined(__sun) || defined(__i386__)) +#if defined(__SVR4) && defined(__sun) #include #include #include @@ -92,30 +91,17 @@ #include -#if !defined(__sun) || defined(HAVE_SYS_VT_H) +#ifdef HAVE_SYS_VT_H #define HAS_USL_VTS #endif -#if !defined(__sun) -#include -#endif -#if defined(HAS_USL_VTS) -#if !defined(__sun) -#include -#endif +#ifdef HAS_USL_VTS #include #include #endif -#if !defined(VT_ACKACQ) -#define VT_ACKACQ 2 -#endif /* !VT_ACKACQ */ - -#if !(defined(__sun) && defined (SVR4)) -#define DEV_MEM "/dev/pmem" -#endif #define CLEARDTR_SUPPORT -#endif /* SVR4 */ +#endif /* SVR4 && __sun */ /**************************************************************************/ /* Linux or Glibc-based system */ diff --git a/os/access.c b/os/access.c index cbc4e96fd..bacdee432 100644 --- a/os/access.c +++ b/os/access.c @@ -156,20 +156,13 @@ SOFTWARE. #ifdef HAVE_GETIFADDRS #include -#endif +#else -/* Solaris provides an extended interface SIOCGLIFCONF. Other systems - * may have this as well, but the code has only been tested on Solaris - * so far, so we only enable it there. Other platforms may be added as - * needed. - * - * Test for Solaris commented out -- TSI @ UQV 2003.06.13 - */ +/* Solaris provides an extended interface SIOCGLIFCONF. */ #ifdef SIOCGLIFCONF -/* #if defined(__sun) */ #define USE_SIOCGLIFCONF -/* #endif */ #endif +#endif /* HAVE_GETIFADDRS */ #include @@ -396,38 +389,6 @@ AccessUsingXdmcp(void) LocalHostEnabled = FALSE; } -#if defined(SVR4) && !defined(__sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) - -/* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ - -static int -ifioctl(int fd, int cmd, char *arg) -{ - struct strioctl ioc; - int ret; - - memset((char *) &ioc, 0, sizeof(ioc)); - ioc.ic_cmd = cmd; - ioc.ic_timout = 0; - if (cmd == SIOCGIFCONF) { - ioc.ic_len = ((struct ifconf *) arg)->ifc_len; - ioc.ic_dp = ((struct ifconf *) arg)->ifc_buf; - } - else { - ioc.ic_len = sizeof(struct ifreq); - ioc.ic_dp = arg; - } - ret = ioctl(fd, I_STR, (char *) &ioc); - if (ret >= 0 && cmd == SIOCGIFCONF) -#ifdef SVR4 - ((struct ifconf *) arg)->ifc_len = ioc.ic_len; -#endif - return ret; -} -#else -#define ifioctl ioctl -#endif - /* * DefineSelf (fd): * @@ -656,7 +617,7 @@ DefineSelf(int fd) #define IFR_IFR_NAME ifr->ifr_name #endif - if (ifioctl(fd, IFC_IOCTL_REQ, (void *) &ifc) < 0) + if (ioctl(fd, IFC_IOCTL_REQ, (void *) &ifc) < 0) ErrorF("Getting interface configuration (4): %s\n", strerror(errno)); cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN; @@ -760,12 +721,12 @@ DefineSelf(int fd) struct ifreq broad_req; broad_req = *ifr; - if (ifioctl(fd, SIOCGIFFLAGS, (void *) &broad_req) != -1 && + if (ioctl(fd, SIOCGIFFLAGS, (void *) &broad_req) != -1 && (broad_req.ifr_flags & IFF_BROADCAST) && (broad_req.ifr_flags & IFF_UP) ) { broad_req = *ifr; - if (ifioctl(fd, SIOCGIFBRDADDR, (void *) &broad_req) != -1) + if (ioctl(fd, SIOCGIFBRDADDR, (void *) &broad_req) != -1) broad_addr = broad_req.ifr_addr; else continue; diff --git a/os/io.c b/os/io.c index 43c4e5d30..d4c03f3a7 100644 --- a/os/io.c +++ b/os/io.c @@ -359,13 +359,8 @@ ReadRequestFromClient(ClientPtr client) if (result <= 0) { if ((result < 0) && ETEST(errno)) { mark_client_not_ready(client); -#if defined(SVR4) && defined(__i386__) && !defined(__sun) - if (0) -#endif - { - YieldControlNoInput(client); - return 0; - } + YieldControlNoInput(client); + return 0; } YieldControlDeath(); return -1;