From 0f9a11a94b5fb52b5f1f9c79a93c54fc6396cab8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 18:41:52 +0100 Subject: drop platform support: unifdef __UNIXOS2__. Fixes ArcticaProject/nx-libs#271. --- nx-X11/programs/Xserver/os/WaitFor.c | 3 --- nx-X11/programs/Xserver/os/access.c | 7 ------- nx-X11/programs/Xserver/os/connection.c | 29 +---------------------------- nx-X11/programs/Xserver/os/io.c | 6 +----- nx-X11/programs/Xserver/os/log.c | 3 --- nx-X11/programs/Xserver/os/oscolor.c | 11 ----------- nx-X11/programs/Xserver/os/osdep.h | 2 +- nx-X11/programs/Xserver/os/osinit.c | 2 +- nx-X11/programs/Xserver/os/utils.c | 26 ++++---------------------- 9 files changed, 8 insertions(+), 81 deletions(-) (limited to 'nx-X11/programs/Xserver/os') diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 2858637fa..899b1de0b 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -91,9 +91,6 @@ SOFTWARE. #include #include "misc.h" -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -#endif #include "osdep.h" #include #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 5735fd556..c775952e2 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -1139,9 +1139,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) { @@ -1152,10 +1149,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]); diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 9681ced38..e38e94c67 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -107,11 +107,6 @@ SOFTWARE. #include #endif -#ifdef __UNIXOS2__ -#define select(n,r,w,x,t) os2PseudoSelect(n,r,w,x,t) -extern __const__ int _nfiles; -#endif - #if defined(TCPCONN) # include # include @@ -124,21 +119,17 @@ extern __const__ int _nfiles; # ifdef CSRG_BASED # include # endif -# ifndef __UNIXOS2__ -# include -# endif +# include # endif # endif # include #endif -#if !defined(__UNIXOS2__) #ifndef Lynx #include #else #include #endif -#endif #endif /* WIN32 */ #include "misc.h" #include "osdep.h" @@ -173,9 +164,6 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ 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; @@ -314,8 +302,6 @@ InitConnectionLimits(void) #ifndef __CYGWIN__ -#ifndef __UNIXOS2__ - #if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) lastfdesc = sysconf(_SC_OPEN_MAX) - 1; #endif @@ -330,10 +316,6 @@ InitConnectionLimits(void) lastfdesc = _NFILE - 1; #endif -#else /* __UNIXOS2__ */ - lastfdesc = _nfiles - 1; -#endif - #endif /* __CYGWIN__ */ /* This is the fallback */ @@ -449,15 +431,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); diff --git a/nx-X11/programs/Xserver/os/io.c b/nx-X11/programs/Xserver/os/io.c index d184a981c..8439a3edd 100644 --- a/nx-X11/programs/Xserver/os/io.c +++ b/nx-X11/programs/Xserver/os/io.c @@ -70,7 +70,7 @@ SOFTWARE. #include #include #include -#if !defined(__UNIXOS2__) && !defined(WIN32) +#if !defined(WIN32) #ifndef Lynx #include #else @@ -92,7 +92,6 @@ CallbackListPtr FlushCallback; /* 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) @@ -106,9 +105,6 @@ CallbackListPtr FlushCallback; #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 Bool CriticalOutputPending; int timesThisConnection = 0; diff --git a/nx-X11/programs/Xserver/os/log.c b/nx-X11/programs/Xserver/os/log.c index e964896d7..d82f545a0 100644 --- a/nx-X11/programs/Xserver/os/log.c +++ b/nx-X11/programs/Xserver/os/log.c @@ -214,9 +214,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/nx-X11/programs/Xserver/os/oscolor.c b/nx-X11/programs/Xserver/os/oscolor.c index 32f8a4b23..88b243d65 100644 --- a/nx-X11/programs/Xserver/os/oscolor.c +++ b/nx-X11/programs/Xserver/os/oscolor.c @@ -397,7 +397,6 @@ OsInitColors(void) if (!was_here) { -#ifndef __UNIXOS2__ #ifdef NX_TRANS_SOCKET /* * Add the trailing '.txt' if a @@ -417,12 +416,6 @@ OsInitColors(void) path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); strcpy(path, rgbPath); strcat(path, ".txt"); -#endif -#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"))) { @@ -438,11 +431,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/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h index 9ad267a36..3215b017e 100644 --- a/nx-X11/programs/Xserver/os/osdep.h +++ b/nx-X11/programs/Xserver/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/nx-X11/programs/Xserver/os/osinit.c b/nx-X11/programs/Xserver/os/osinit.c index 5f097f89a..81429a462 100644 --- a/nx-X11/programs/Xserver/os/osinit.c +++ b/nx-X11/programs/Xserver/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/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c index 9584dadd3..fca5ae2fd 100644 --- a/nx-X11/programs/Xserver/os/utils.c +++ b/nx-X11/programs/Xserver/os/utils.c @@ -318,9 +318,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" @@ -330,10 +328,6 @@ OsSignal(sig, handler) #include #endif -#ifdef __UNIXOS2__ -#define link rename -#endif - #ifndef PATH_MAX #ifndef Lynx #include @@ -372,14 +366,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) : @@ -422,12 +409,10 @@ LockServer(void) if (write(lfd, pid_str, 11) != 11) FatalError("Could not write pid to lock file in %s\n", tmp); -#ifndef __UNIXOS2__ #ifndef USE_CHMOD (void) fchmod(lfd, 0444); #else (void) chmod(tmp, 0444); -#endif #endif (void) close(lfd); @@ -507,9 +492,6 @@ UnlockServer(void) if (!StillLocking){ -#ifdef __UNIXOS2__ - (void) chmod(LockFile,S_IREAD|S_IWRITE); -#endif /* __UNIXOS2__ */ (void) unlink(LockFile); } } @@ -928,7 +910,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 @@ -1260,7 +1242,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 @@ -1609,7 +1591,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. @@ -1964,7 +1946,7 @@ Fclose(void * iop) #endif } -#endif /* !WIN32 && !__UNIXOS2__ */ +#endif /* !WIN32 */ /* -- cgit v1.2.3