diff options
Diffstat (limited to 'nx-X11/programs/Xserver/os')
-rw-r--r-- | nx-X11/programs/Xserver/os/Imakefile | 9 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/os/access.c | 156 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/os/connection.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/os/osdep.h | 3 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/os/osinit.c | 7 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/os/utils.c | 27 |
6 files changed, 9 insertions, 197 deletions
diff --git a/nx-X11/programs/Xserver/os/Imakefile b/nx-X11/programs/Xserver/os/Imakefile index 421f3a85a..69764a7d8 100644 --- a/nx-X11/programs/Xserver/os/Imakefile +++ b/nx-X11/programs/Xserver/os/Imakefile @@ -75,21 +75,18 @@ XDMAUTHOBJS = XDMAUTHSCRS = #endif -TIRPC_INCLUDES = - #if HasSecureRPC +#if UseTIRPC RPCDEFS = -DSECURE_RPC RPCOBJS = rpcauth.o RPCSRCS = rpcauth.c - -#if UseTIRPC TIRPC_INCLUDES = $$(pkg-config --cflags-only-I 'libtirpc') -#endif - #else RPCDEFS = RPCOBJS = RPCSRCS = +TIRPC_INCLUDES = +#endif #endif #if HasBSD44Sockets diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index bea4b968a..88055546e 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -310,151 +310,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, (void **)&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) void @@ -541,8 +396,8 @@ DefineSelf (int fd) */ if (family == FamilyInternet && !(len == 4 && - ((addr[0] == 127 && addr[1] == 0 && - addr[2] == 0 && addr[3] == 1) || + /* backport 75b9383d8a4c113ab3c6cfc1d5efcb5d9982a1bf */ + ((addr[0] == 127 || (addr[0] == 0 && addr[1] == 0 && addr[2] == 0 && addr[3] == 0))) ) @@ -755,8 +610,7 @@ DefineSelf (int fd) * on the other end of the wire */ if (family == FamilyInternet && - addr[0] == 127 && addr[1] == 0 && - addr[2] == 0 && addr[3] == 1) + addr[0] == 127) continue; #if defined(IPv6) && defined(AF_INET6) else if (family == FamilyInternet6 && @@ -903,8 +757,7 @@ DefineSelf (int fd) continue; if (family == FamilyInternet && - addr[0] == 127 && addr[1] == 0 && - addr[2] == 0 && addr[3] == 1) + addr[0] == 127) continue; /* @@ -966,7 +819,6 @@ DefineSelf (int fd) } } #endif /* !SIOCGIFCONF */ -#endif /* WINTCP */ #ifdef XDMCP void diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 4d30dd86f..78ce8e03f 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -111,11 +111,7 @@ SOFTWARE. #include <nx-X11/extensions/security.h> #endif -#ifdef X_NOT_POSIX -#define Pid_t int -#else #define Pid_t pid_t -#endif int lastfdesc; /* maximum file descriptor */ diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index e106c5544..f2279dd6c 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/os/osdep.h @@ -60,7 +60,6 @@ SOFTWARE. #include <X11/Xdmcp.h> -#ifndef X_NOT_POSIX #ifdef _POSIX_SOURCE #include <limits.h> #else @@ -68,8 +67,6 @@ SOFTWARE. #include <limits.h> #undef _POSIX_SOURCE #endif -#else /* X_NOT_POSIX */ -#endif /* X_NOT_POSIX */ #ifndef OPEN_MAX #ifdef SVR4 diff --git a/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 367635f6c..0313a8990 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/os/osinit.c @@ -138,15 +138,8 @@ OsInit(void) #endif } -#ifndef X_NOT_POSIX if (getpgrp () == 0) setpgid (0, 0); -#else -#if !defined(SYSV) - if (getpgrp (0) == 0) - setpgrp (0, getpid ()); -#endif -#endif #ifdef RLIMIT_DATA if (limitDataSpace >= 0) diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index d49235b75..d6a23375d 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -276,9 +276,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); @@ -289,7 +286,6 @@ OsSignal(sig, handler) if (sigaction(sig, &act, &oact)) perror("sigaction"); return oact.sa_handler; -#endif } #ifdef SERVER_LOCK @@ -381,11 +377,7 @@ LockServer(void) if (write(lfd, pid_str, 11) != 11) FatalError("Could not write pid to lock file in %s\n", tmp); -#ifndef USE_CHMOD - (void) fchmod(lfd, 0444); -#else (void) chmod(tmp, 0444); -#endif (void) close(lfd); /* @@ -471,28 +463,19 @@ UnlockServer(void) /* Force connections to close on SIGHUP from init */ -/*ARGSUSED*/ -SIGVAL +void AutoResetServer (int sig) { int olderrno = errno; 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; } /* Force connections to close and then exit on SIGTERM, SIGINT */ -/*ARGSUSED*/ -SIGVAL +void GiveUp(int sig) { int olderrno = errno; @@ -503,10 +486,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; } @@ -1214,10 +1193,8 @@ ExpandCommandLine(int *pargc, char ***pargv) { int i; -#if !defined(__CYGWIN__) if (getuid() != geteuid()) return; -#endif for (i = 1; i < *pargc; i++) { |