diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-08-02 14:27:03 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-08-02 14:27:03 -0400 |
commit | e34fcd2bf42dbd72ab6ce2df80f2dcaa13416e74 (patch) | |
tree | c9639b11acb0ff6c90d774574b0392d81320e84e /os | |
parent | 32c0dcc8c0d1edba5d7e418fd2dc916847a4f069 (diff) | |
parent | f3955c0a020b39021050cd33c20a17f14fc4b579 (diff) |
Merge branch 'master' into XACE-SELINUX
Conflicts:
dix/devices.c
dix/property.c
include/dix.h
Diffstat (limited to 'os')
-rw-r--r-- | os/Makefile.am | 6 | ||||
-rw-r--r-- | os/WaitFor.c | 3 | ||||
-rw-r--r-- | os/access.c | 9 | ||||
-rw-r--r-- | os/connection.c | 37 | ||||
-rw-r--r-- | os/io.c | 6 | ||||
-rw-r--r-- | os/log.c | 3 | ||||
-rw-r--r-- | os/oscolor.c | 11 | ||||
-rw-r--r-- | os/osdep.h | 2 | ||||
-rw-r--r-- | os/osinit.c | 2 | ||||
-rw-r--r-- | os/strlcat.c | 3 | ||||
-rw-r--r-- | os/strlcpy.c | 3 | ||||
-rw-r--r-- | os/utils.c | 26 |
12 files changed, 20 insertions, 91 deletions
diff --git a/os/Makefile.am b/os/Makefile.am index c5e7b0397..53b2d7f0c 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -59,5 +59,9 @@ noinst_PROGRAMS = os.O os.O: dtrace.o $(am_libos_la_OBJECTS) ld -r -o $@ dtrace.o .libs/*.o - endif + +os.c: + touch $@ + +CLEANFILES = os.c diff --git a/os/WaitFor.c b/os/WaitFor.c index 4a606ac7d..ec1592c01 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -67,9 +67,6 @@ SOFTWARE. #include <X11/X.h> #include "misc.h" -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -#endif #include "osdep.h" #include <X11/Xpoll.h> #include "dixstruct.h" diff --git a/os/access.c b/os/access.c index 7281d967d..8d96e0420 100644 --- a/os/access.c +++ b/os/access.c @@ -1193,9 +1193,6 @@ ResetHosts (char *display) if (fnamelen > sizeof(fname)) FatalError("Display name `%s' is too long\n", display); sprintf(fname, ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX, display); -#ifdef __UNIXOS2__ - strcpy(fname, (char*)__XOS2RedirRoot(fname)); -#endif /* __UNIXOS2__ */ if ((fd = fopen (fname, "r")) != 0) { @@ -1206,10 +1203,6 @@ ResetHosts (char *display) continue; if ((ptr = strchr(ohostname, '\n')) != 0) *ptr = 0; -#ifdef __UNIXOS2__ - if ((ptr = strchr(ohostname, '\r')) != 0) - *ptr = 0; -#endif hostlen = strlen(ohostname) + 1; for (i = 0; i < hostlen; i++) lhostname[i] = tolower(ohostname[i]); @@ -1825,7 +1818,7 @@ ConvertAddr ( switch (saddr->sa_family) { case AF_UNSPEC: -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) +#if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: #endif return FamilyLocal; diff --git a/os/connection.c b/os/connection.c index cb3443c5b..d975f87d2 100644 --- a/os/connection.c +++ b/os/connection.c @@ -107,11 +107,6 @@ SOFTWARE. #include <sys/ioctl.h> #endif -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -extern __const__ int _nfiles; -#endif - #if defined(TCPCONN) || defined(STREAMSCONN) # include <netinet/in.h> # include <arpa/inet.h> @@ -124,21 +119,17 @@ extern __const__ int _nfiles; # ifdef CSRG_BASED # include <sys/param.h> # endif -# ifndef __UNIXOS2__ -# include <netinet/tcp.h> -# endif +# include <netinet/tcp.h> # endif # endif # include <arpa/inet.h> #endif -#if !defined(__UNIXOS2__) #ifndef Lynx #include <sys/uio.h> #else #include <uio.h> #endif -#endif #endif /* WIN32 */ #include "misc.h" /* for typedef of pointer */ #include "osdep.h" @@ -171,8 +162,10 @@ extern __const__ int _nfiles; #ifdef XSERVER_DTRACE # include <sys/types.h> typedef const char *string; +# ifndef HAS_GETPEERUCRED +# define zoneid_t int +# endif # include "../dix/Xserver-dtrace.h" -# include <ucred.h> #endif static int lastfdesc; /* maximum file descriptor */ @@ -192,9 +185,6 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; -#ifdef __UNIXOS2__ -Pid_t GetPPID(Pid_t pid); -#endif static Bool debug_conns = FALSE; @@ -327,8 +317,6 @@ InitConnectionLimits(void) #ifndef __CYGWIN__ -#ifndef __UNIXOS2__ - #if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) lastfdesc = sysconf(_SC_OPEN_MAX) - 1; #endif @@ -343,10 +331,6 @@ InitConnectionLimits(void) lastfdesc = _NFILE - 1; #endif -#else /* __UNIXOS2__ */ - lastfdesc = _nfiles - 1; -#endif - #endif /* __CYGWIN__ */ /* This is the fallback */ @@ -462,15 +446,6 @@ CreateWellKnownSockets(void) RunFromSmartParent = TRUE; OsSignal(SIGUSR1, handler); ParentProcess = getppid (); -#ifdef __UNIXOS2__ - /* - * fg030505: under OS/2, xinit is not the parent process but - * the "grant parent" process of the server because execvpe() - * presents us an additional process number; - * GetPPID(pid) is part of libemxfix - */ - ParentProcess = GetPPID (ParentProcess); -#endif /* __UNIXOS2__ */ if (RunFromSmartParent) { if (ParentProcess > 1) { kill (ParentProcess, SIGUSR1); @@ -563,6 +538,8 @@ AuthAudit (ClientPtr client, Bool letin, char client_uid_string[64]; #ifdef HAS_GETPEERUCRED ucred_t *peercred = NULL; +#endif +#if defined(HAS_GETPEERUCRED) || defined(XSERVER_DTRACE) pid_t client_pid = -1; zoneid_t client_zid = -1; #endif @@ -573,7 +550,7 @@ AuthAudit (ClientPtr client, Bool letin, switch (saddr->sa_family) { case AF_UNSPEC: -#if defined(UNIXCONN) || defined(LOCALCONN) || defined(OS2PIPECONN) +#if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: #endif strcpy(out, "local host"); @@ -70,7 +70,7 @@ SOFTWARE. #include <X11/Xtrans/Xtrans.h> #include <X11/Xmd.h> #include <errno.h> -#if !defined(__UNIXOS2__) && !defined(WIN32) +#if !defined(WIN32) #ifndef Lynx #include <sys/uio.h> #else @@ -98,7 +98,6 @@ static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped); /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX * systems are broken and return EWOULDBLOCK when they should return EAGAIN */ -#ifndef __UNIXOS2__ #ifndef WIN32 #if defined(EAGAIN) && defined(EWOULDBLOCK) #define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) @@ -112,9 +111,6 @@ static void SkipRequests(xReqPtr req, ClientPtr client, int numskipped); #else /* WIN32 The socket errorcodes differ from the normal errors*/ #define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK) #endif -#else /* __UNIXOS2__ Writing to full pipes may return ENOSPC */ -#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK || err == ENOSPC) -#endif static Bool CriticalOutputPending; static int timesThisConnection = 0; @@ -182,9 +182,6 @@ LogInit(const char *fname, const char *backup) sprintf(suffix, backup, display); sprintf(oldLog, "%s%s", logFileName, suffix); free(suffix); -#ifdef __UNIXOS2__ - remove(oldLog); -#endif if (rename(logFileName, oldLog) == -1) { FatalError("Cannot move old log file (\"%s\" to \"%s\"\n", logFileName, oldLog); diff --git a/os/oscolor.c b/os/oscolor.c index d53e4d8ff..e1756926d 100644 --- a/os/oscolor.c +++ b/os/oscolor.c @@ -225,16 +225,9 @@ OsInitColors(void) if (!was_here) { -#ifndef __UNIXOS2__ path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); strcpy(path, rgbPath); strcat(path, ".txt"); -#else - char *tmp = (char*)__XOS2RedirRoot(rgbPath); - path = (char*)ALLOCATE_LOCAL(strlen(tmp) +5); - strcpy(path, tmp); - strcat(path, ".txt"); -#endif if (!(rgb = fopen(path, "r"))) { ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); @@ -245,11 +238,7 @@ OsInitColors(void) while(fgets(line, sizeof(line), rgb)) { lineno++; -#ifndef __UNIXOS2__ if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) -#else - if (sscanf(line,"%d %d %d %[^\n\r]\n", &red, &green, &blue, name) == 4) -#endif { if (red >= 0 && red <= 0xff && green >= 0 && green <= 0xff && diff --git a/os/osdep.h b/os/osdep.h index 04e88ea49..965436df5 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -91,7 +91,7 @@ SOFTWARE. #if defined(NOFILE) && !defined(NOFILES_MAX) #define OPEN_MAX NOFILE #else -#if !defined(__UNIXOS2__) && !defined(WIN32) +#if !defined(WIN32) #define OPEN_MAX NOFILES_MAX #else #define OPEN_MAX 256 diff --git a/os/osinit.c b/os/osinit.c index 9a1c1133a..1f09f068e 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -133,7 +133,7 @@ OsInit(void) dup2 (fileno (err), 2); fclose (err); } -#if defined(SYSV) || defined(SVR4) || defined(__UNIXOS2__) || defined(WIN32) || defined(__CYGWIN__) +#if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__) { static char buf[BUFSIZ]; setvbuf (stderr, buf, _IOLBF, BUFSIZ); diff --git a/os/strlcat.c b/os/strlcat.c index 28e2338f9..b57fcc563 100644 --- a/os/strlcat.c +++ b/os/strlcat.c @@ -1,5 +1,3 @@ -/* $OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $ */ - /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> * @@ -15,7 +13,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86$ */ #ifdef HAVE_XORG_CONFIG_H diff --git a/os/strlcpy.c b/os/strlcpy.c index 42442cc30..989d0385e 100644 --- a/os/strlcpy.c +++ b/os/strlcpy.c @@ -1,5 +1,3 @@ -/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */ - /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> * @@ -15,7 +13,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86$ */ #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> diff --git a/os/utils.c b/os/utils.c index dd5acd34b..3bb7dbeba 100644 --- a/os/utils.c +++ b/os/utils.c @@ -297,9 +297,7 @@ OsSignal(sig, handler) * server at a time. This keeps the servers from stomping on each other * if the user forgets to give them different display numbers. */ -#ifndef __UNIXOS2__ #define LOCK_DIR "/tmp" -#endif #define LOCK_TMP_PREFIX "/.tX" #define LOCK_PREFIX "/.X" #define LOCK_SUFFIX "-lock" @@ -309,10 +307,6 @@ OsSignal(sig, handler) #include <sys/param.h> #endif -#ifdef __UNIXOS2__ -#define link rename -#endif - #ifndef PATH_MAX #ifndef Lynx #include <sys/param.h> @@ -351,14 +345,7 @@ LockServer(void) /* * Path names */ -#ifndef __UNIXOS2__ tmppath = LOCK_DIR; -#else - /* OS/2 uses TMP directory, must also prepare for 8.3 names */ - tmppath = getenv("TMP"); - if (!tmppath) - FatalError("No TMP dir found\n"); -#endif sprintf(port, "%d", atoi(display)); len = strlen(LOCK_PREFIX) > strlen(LOCK_TMP_PREFIX) ? strlen(LOCK_PREFIX) : @@ -399,13 +386,11 @@ 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 __UNIXOS2__ #ifndef USE_CHMOD (void) fchmod(lfd, 0444); #else (void) chmod(tmp, 0444); #endif -#endif (void) close(lfd); /* @@ -484,9 +469,6 @@ UnlockServer(void) if (!StillLocking){ -#ifdef __UNIXOS2__ - (void) chmod(LockFile,S_IREAD|S_IWRITE); -#endif /* __UNIXOS2__ */ (void) unlink(LockFile); } } @@ -914,7 +896,7 @@ ProcessCommandLine(int argc, char *argv[]) #ifdef SERVER_LOCK else if ( strcmp ( argv[i], "-nolock") == 0) { -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) +#if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != 0) ErrorF("Warning: the -nolock option can only be used by root\n"); else @@ -1246,7 +1228,7 @@ ExpandCommandLine(int *pargc, char ***pargv) { int i; -#if !defined(WIN32) && !defined(__UNIXOS2__) && !defined(__CYGWIN__) +#if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != geteuid()) return; #endif @@ -1677,7 +1659,7 @@ OsReleaseSignals (void) #endif } -#if !defined(WIN32) && !defined(__UNIXOS2__) +#if !defined(WIN32) /* * "safer" versions of system(3), popen(3) and pclose(3) which give up * all privs before running a command. @@ -1952,7 +1934,7 @@ Fclose(pointer iop) #endif } -#endif /* !WIN32 && !__UNIXOS2__ */ +#endif /* !WIN32 */ /* |