diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-07-17 21:37:50 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-07-17 21:37:50 +0300 |
commit | 446fe9eecddd1337f9d5164dd7c301e1ba3dfe32 (patch) | |
tree | e749fe520d2226df0397a407e7353c065bbc5248 /os | |
parent | 0564b5454ac101d9e1218767bbbc2c2d9f3e0696 (diff) |
Dead code removal
Remove a whole bunch of code that was never built, be it entire files or
just dead ifdefs.
Diffstat (limited to 'os')
-rw-r--r-- | os/access.c | 167 | ||||
-rw-r--r-- | os/connection.c | 16 | ||||
-rw-r--r-- | os/io.c | 8 | ||||
-rw-r--r-- | os/log.c | 18 | ||||
-rw-r--r-- | os/osdep.h | 8 | ||||
-rw-r--r-- | os/osinit.c | 11 | ||||
-rw-r--r-- | os/rpcauth.c | 10 | ||||
-rw-r--r-- | os/utils.c | 35 | ||||
-rw-r--r-- | os/xdmcp.c | 5 |
9 files changed, 5 insertions, 273 deletions
diff --git a/os/access.c b/os/access.c index de9e35e0b..93e33b52f 100644 --- a/os/access.c +++ b/os/access.c @@ -95,20 +95,6 @@ SOFTWARE. # endif #endif -#if defined(DGUX) -#include <sys/ioctl.h> -#include <sys/socket.h> -#include <net/if.h> -#include <netinet/in.h> -#include <ctype.h> -#include <sys/utsname.h> -#include <sys/stream.h> -#include <sys/stropts.h> -#include <sys/param.h> -#include <sys/sockio.h> -#endif - - #if defined(hpux) || defined(QNX4) # include <sys/utsname.h> # ifdef HAS_IFREQ @@ -304,7 +290,7 @@ AccessUsingXdmcp (void) } -#if ((defined(SVR4) && !defined(DGUX) && !defined(SCO325) && !defined(sun) && !defined(NCR)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if ((defined(SVR4) && !defined(SCO325) && !defined(sun)) || defined(ISC)) && !defined(__sgi) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ @@ -353,9 +339,9 @@ ifioctl (int fd, int cmd, char *arg) #endif return(ret); } -#else /* Case DGUX, sun, SCO325 NCR and others */ +#else /* Case sun, SCO325 and others */ #define ifioctl ioctl -#endif /* ((SVR4 && !DGUX !sun !SCO325 !NCR) || ISC) && SIOCGIFCONF */ +#endif /* ((SVR4 && !sun !SCO325) || ISC) && SIOCGIFCONF */ /* * DefineSelf (fd): @@ -364,152 +350,6 @@ ifioctl (int fd, int cmd, char *arg) * for this fd and add them to the selfhosts list. */ -#ifdef WINTCP /* NCR Wollongong based TCP */ - -#include <sys/un.h> -#include <stropts.h> -#include <tiuser.h> - -#include <sys/stream.h> -#include <net/if.h> -#include <netinet/ip.h> -#include <netinet/ip_var.h> -#include <netinet/in.h> -#include <netinet/in_var.h> - -void -DefineSelf (int fd) -{ - /* - * The Wolongong drivers used by NCR SVR4/MP-RAS don't understand the - * socket IO calls that most other drivers seem to like. Because of - * this, this routine must be special cased for NCR. Eventually, - * this will be cleared up. - */ - - struct ipb ifnet; - struct in_ifaddr ifaddr; - struct strioctl str; - unsigned char *addr; - register HOST *host; - int family, len; - - if ((fd = open ("/dev/ip", O_RDWR, 0 )) < 0) - Error ("Getting interface configuration (1)"); - - /* Indicate that we want to start at the begining */ - ifnet.ib_next = (struct ipb *) 1; - - while (ifnet.ib_next) - { - str.ic_cmd = IPIOC_GETIPB; - str.ic_timout = 0; - str.ic_len = sizeof (struct ipb); - str.ic_dp = (char *) &ifnet; - - if (ioctl (fd, (int) I_STR, (char *) &str) < 0) - { - close (fd); - Error ("Getting interface configuration (2)"); - } - - ifaddr.ia_next = (struct in_ifaddr *) ifnet.if_addrlist; - str.ic_cmd = IPIOC_GETINADDR; - str.ic_timout = 0; - str.ic_len = sizeof (struct in_ifaddr); - str.ic_dp = (char *) &ifaddr; - - if (ioctl (fd, (int) I_STR, (char *) &str) < 0) - { - close (fd); - Error ("Getting interface configuration (3)"); - } - - len = sizeof(struct sockaddr_in); - family = ConvertAddr (IA_SIN(&ifaddr), &len, (pointer *)&addr); - if (family == -1 || family == FamilyLocal) - continue; - for (host = selfhosts; - host && !addrEqual (family, addr, len, host); - host = host->next) - ; - if (host) - continue; - MakeHost(host,len) - if (host) - { - host->family = family; - host->len = len; - acopy(addr, host->addr, len); - host->next = selfhosts; - selfhosts = host; - } -#ifdef XDMCP - { - struct sockaddr broad_addr; - - /* - * If this isn't an Internet Address, don't register it. - */ - if (family != FamilyInternet) - continue; - - /* - * Ignore 'localhost' entries as they're not useful - * on the other end of the wire. - */ - if (len == 4 && - addr[0] == 127 && addr[1] == 0 && - addr[2] == 0 && addr[3] == 1) - continue; - - /* - * Ignore '0.0.0.0' entries as they are - * returned by some OSes for unconfigured NICs but they are - * not useful on the other end of the wire. - */ - if (len == 4 && - addr[0] == 0 && addr[1] == 0 && - addr[2] == 0 && addr[3] == 0) - continue; - - XdmcpRegisterConnection (family, (char *)addr, len); - - -#define IA_BROADADDR(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_broadaddr)) - - XdmcpRegisterBroadcastAddress ( - (struct sockaddr_in *) IA_BROADADDR(&ifaddr)); - -#undef IA_BROADADDR - } -#endif /* XDMCP */ - } - - close(fd); - - /* - * add something of FamilyLocalHost - */ - for (host = selfhosts; - host && !addrEqual(FamilyLocalHost, "", 0, host); - host = host->next); - if (!host) - { - MakeHost(host, 0); - if (host) - { - host->family = FamilyLocalHost; - host->len = 0; - acopy("", host->addr, 0); - host->next = selfhosts; - selfhosts = host; - } - } -} - -#else /* WINTCP */ - #if !defined(SIOCGIFCONF) || (defined (hpux) && ! defined (HAS_IFREQ)) || defined(QNX4) void DefineSelf (int fd) @@ -1089,7 +929,6 @@ DefineSelf (int fd) } } #endif /* hpux && !HAS_IFREQ */ -#endif /* WINTCP */ #ifdef XDMCP void diff --git a/os/connection.c b/os/connection.c index 98bb35bcd..021776271 100644 --- a/os/connection.c +++ b/os/connection.c @@ -90,18 +90,6 @@ SOFTWARE. #include <sys/ioctl.h> #endif -#if defined(DGUX) -#include <sys/ioctl.h> -#include <sys/utsname.h> -#include <sys/socket.h> -#include <sys/uio.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <sys/param.h> -#include <unistd.h> -#endif - - #ifdef AIXV3 #include <sys/ioctl.h> #endif @@ -134,11 +122,7 @@ SOFTWARE. #include "dixstruct.h" #include "xace.h" -#ifdef X_NOT_POSIX -#define Pid_t int -#else #define Pid_t pid_t -#endif #ifdef DNETCONN #include <netdnet/dn.h> @@ -92,15 +92,7 @@ static ConnectionOutputPtr AllocateOutputBuffer(void); * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ #ifndef WIN32 -#if defined(EAGAIN) && defined(EWOULDBLOCK) #define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) -#else -#ifdef EAGAIN -#define ETEST(err) (err == EAGAIN) -#else -#define ETEST(err) (err == EWOULDBLOCK) -#endif -#endif #else /* WIN32 The socket errorcodes differ from the normal errors*/ #define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) #endif @@ -528,9 +528,6 @@ FatalError(const char *f, ...) if (!beenhere) OsVendorFatalError(); #endif -#ifdef ABORTONFATALERROR - abort(); -#endif if (!beenhere) { beenhere = TRUE; AbortServer(); @@ -564,21 +561,6 @@ ErrorF(const char * f, ...) /* A perror() workalike. */ -#ifndef NEED_STRERROR -#ifdef SYSV -#if !defined(ISC) || defined(ISC202) || defined(ISC22) -#define NEED_STRERROR -#endif -#endif -#endif - -#if defined(NEED_STRERROR) && !defined(strerror) -extern char *sys_errlist[]; -extern int sys_nerr; -#define strerror(n) \ - ((n) >= 0 && (n) < sys_nerr) ? sys_errlist[(n)] : "unknown error" -#endif - _X_EXPORT void Error(char *str) { diff --git a/os/osdep.h b/os/osdep.h index 84f7177db..2f7bd7585 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -59,7 +59,6 @@ SOFTWARE. #include <X11/Xdmcp.h> #ifndef sgi /* SGI defines OPEN_MAX in a useless way */ -#ifndef X_NOT_POSIX #ifdef _POSIX_SOURCE #include <limits.h> #else @@ -67,13 +66,6 @@ SOFTWARE. #include <limits.h> #undef _POSIX_SOURCE #endif -#else /* X_NOT_POSIX */ -#ifdef WIN32 -#define _POSIX_ -#include <limits.h> -#undef _POSIX_ -#endif -#endif /* X_NOT_POSIX */ #endif #ifdef __QNX__ diff --git a/os/osinit.c b/os/osinit.c index 1b58e1afe..d7f493463 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -141,15 +141,8 @@ OsInit(void) #endif } -#ifndef X_NOT_POSIX if (getpgrp () == 0) setpgid (0, 0); -#else -#if !defined(SYSV) && !defined(WIN32) - if (getpgrp (0) == 0) - setpgrp (0, getpid ()); -#endif -#endif #ifdef RLIMIT_DATA if (limitDataSpace >= 0) @@ -196,9 +189,7 @@ OsInit(void) } } #endif -#ifdef SERVER_LOCK LockServer(); -#endif been_here = TRUE; } TimerInit(); @@ -221,10 +212,8 @@ OsInit(void) void OsCleanup(Bool terminating) { -#ifdef SERVER_LOCK if (terminating) { UnlockServer(); } -#endif } diff --git a/os/rpcauth.c b/os/rpcauth.c index 1e134ad14..1a27c5882 100644 --- a/os/rpcauth.c +++ b/os/rpcauth.c @@ -52,16 +52,6 @@ from The Open Group. extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #endif -#if defined(DGUX) -#include <time.h> -#include <rpc/auth_des.h> -#endif /* DGUX */ - -#ifdef ultrix -#include <time.h> -#include <rpc/auth_des.h> -#endif - static enum auth_stat why; static char * diff --git a/os/utils.c b/os/utils.c index f547926fd..c5339cc90 100644 --- a/os/utils.c +++ b/os/utils.c @@ -83,7 +83,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include <signal.h> #undef _POSIX_C_SOURCE #else -#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) +#if defined(_POSIX_SOURCE) #include <signal.h> #else #define _POSIX_SOURCE @@ -101,11 +101,6 @@ OR PERFORMANCE OF THIS SOFTWARE. #include <ctype.h> /* for isspace */ #include <stdarg.h> -#if defined(DGUX) -#include <sys/resource.h> -#include <netdb.h> -#endif - #include <stdlib.h> /* for malloc() */ #if defined(TCPCONN) || defined(STREAMSCONN) @@ -261,9 +256,6 @@ OsSignal(sig, handler) int sig; OsSigHandlerPtr handler; { -#ifdef X_NOT_POSIX - return signal(sig, handler); -#else struct sigaction act, oact; sigemptyset(&act.sa_mask); @@ -274,10 +266,8 @@ OsSignal(sig, handler) if (sigaction(sig, &act, &oact)) perror("sigaction"); return oact.sa_handler; -#endif } - -#ifdef SERVER_LOCK + /* * Explicit support for a server lock file like the ones used for UUCP. * For architectures with virtual terminals that can run more than one @@ -289,11 +279,6 @@ OsSignal(sig, handler) #define LOCK_PREFIX "/.X" #define LOCK_SUFFIX "-lock" -#if defined(DGUX) -#include <limits.h> -#include <sys/param.h> -#endif - #ifndef PATH_MAX #include <sys/param.h> #ifndef PATH_MAX @@ -369,11 +354,7 @@ LockServer(void) FatalError("Could not create lock file in %s\n", tmp); (void) sprintf(pid_str, "%10ld\n", (long)getpid()); (void) write(lfd, pid_str, 11); -#ifndef USE_CHMOD - (void) fchmod(lfd, 0444); -#else (void) chmod(tmp, 0444); -#endif (void) close(lfd); /* @@ -455,7 +436,6 @@ UnlockServer(void) (void) unlink(LockFile); } } -#endif /* SERVER_LOCK */ /* Force connections to close on SIGHUP from init */ @@ -467,13 +447,6 @@ AutoResetServer (int sig) dispatchException |= DE_RESET; isItTimeToYield = TRUE; -#ifdef GPROF - chdir ("/tmp"); - exit (0); -#endif -#if defined(SYSV) && defined(X_NOT_POSIX) - OsSignal (SIGHUP, AutoResetServer); -#endif errno = olderrno; } @@ -487,10 +460,6 @@ GiveUp(int sig) dispatchException |= DE_TERMINATE; isItTimeToYield = TRUE; -#if defined(SYSV) && defined(X_NOT_POSIX) - if (sig) - OsSignal(sig, SIG_IGN); -#endif errno = olderrno; } diff --git a/os/xdmcp.c b/os/xdmcp.c index ba39284f1..736cd3e11 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -42,11 +42,6 @@ #include "opaque.h" #include "site.h" -#if defined(DGUX) -#include <net/net_ioctl.h> -#include <sys/ioctl.h> -#endif - #ifdef STREAMSCONN #include <tiuser.h> #include <netconfig.h> |