summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xinit.c91
1 files changed, 5 insertions, 86 deletions
diff --git a/xinit.c b/xinit.c
index 6d354eb..667ad56 100644
--- a/xinit.c
+++ b/xinit.c
@@ -66,18 +66,6 @@ in this Software without prior written authorization from The Open Group.
#if !defined(SIGCHLD) && defined(SIGCLD)
#define SIGCHLD SIGCLD
#endif
-#ifdef __UNIXOS2__
-#define INCL_DOSMODULEMGR
-#include <os2.h>
-#define setpgid(a,b)
-#define setuid(a)
-#define setgid(a)
-#define SHELL "cmd.exe"
-#define XINITRC "xinitrc.cmd"
-#define XSERVERRC "xservrc.cmd"
-char **envsave; /* to circumvent an UNIXOS2 problem */
-#define environ envsave
-#endif
#include <stdlib.h>
extern char **environ;
@@ -98,10 +86,6 @@ char **newenvironlast = NULL;
# endif
#endif
-#ifdef __UNIXOS2__
-#define HAS_EXECVPE
-#endif
-
#ifdef HAS_EXECVPE
#define Execvpe(path, argv, envp) execvpe(path, argv, envp)
#else
@@ -153,7 +137,7 @@ static char *displayNum = NULL;
static char *program = NULL;
static Display *xd = NULL; /* server connection */
#ifndef SYSV
-#if defined(__CYGWIN__) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(CSRG_BASED) || defined(__UNIXOS2__) || defined(Lynx) || defined(__APPLE__)
+#if defined(__CYGWIN__) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(CSRG_BASED) || defined(__APPLE__)
int status;
#else
union wait status;
@@ -188,7 +172,7 @@ sigCatch(int sig)
static SIGVAL
sigAlarm(int sig)
{
-#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__UNIXOS2__) || defined(__APPLE__)
+#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__APPLE__)
signal (sig, sigAlarm);
#endif
}
@@ -196,7 +180,7 @@ sigAlarm(int sig)
static SIGVAL
sigUsr1(int sig)
{
-#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__UNIXOS2__) || defined(__APPLE__)
+#if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__APPLE__)
signal (sig, sigUsr1);
#endif
}
@@ -206,23 +190,16 @@ Execute(char **vec, /* has room from up above */
char **envp)
{
Execvpe (vec[0], vec, envp);
-#ifndef __UNIXOS2__
if (access (vec[0], R_OK) == 0) {
vec--; /* back it up to stuff shell in */
vec[0] = SHELL;
Execvpe (vec[0], vec, envp);
}
-#endif
return;
}
-#ifndef __UNIXOS2__
int
main(int argc, char *argv[])
-#else
-int
-main(int argc, char *argv[], char *envp[])
-#endif
{
register char **sptr = server;
register char **cptr = client;
@@ -238,39 +215,13 @@ main(int argc, char *argv[], char *envp[])
#endif
#endif
-#ifdef __UNIXOS2__
- envsave = envp; /* circumvent an EMX problem */
-
- /* Check whether the system will run at all */
- if (_emx_rev < 50) {
- APIRET rc;
- HMODULE hmod;
- char name[CCHMAXPATH];
- char fail[9];
- fputs ("This program requires emx.dll revision 50 (0.9c) "
- "or later.\n", stderr);
- rc = DosLoadModule (fail, sizeof (fail), "emx", &hmod);
- if (rc == 0) {
- rc = DosQueryModuleName (hmod, sizeof (name), name);
- if (rc == 0)
- fprintf (stderr, "Please delete or update `%s'.\n", name);
- DosFreeModule (hmod);
- }
- exit (2);
- }
-#endif
program = *argv++;
argc--;
/*
* copy the client args.
*/
if (argc == 0 ||
-#ifndef __UNIXOS2__
(**argv != '/' && **argv != '.')) {
-#else
- (**argv != '/' && **argv != '\\' && **argv != '.' &&
- !(isalpha(**argv) && (*argv)[1]==':'))) {
-#endif
for (ptr = default_client; *ptr; )
*cptr++ = *ptr++;
} else {
@@ -292,19 +243,8 @@ main(int argc, char *argv[], char *envp[])
* Copy the server args.
*/
if (argc == 0 ||
-#ifndef __UNIXOS2__
(**argv != '/' && **argv != '.')) {
*sptr++ = default_server;
-#else
- (**argv != '/' && **argv != '\\' && **argv != '.' &&
- !(isalpha(**argv) && (*argv)[1]==':'))) {
- *sptr = getenv("XSERVER");
- if (!*sptr) {
- Error("No XSERVER environment variable set");
- exit(1);
- }
- *sptr++;
-#endif
} else {
server_given = 1;
*sptr++ = *argv++;
@@ -490,13 +430,13 @@ processTimeout(int timeout, char *string)
static char *laststring;
for (;;) {
-#if defined(SYSV) || defined(__UNIXOS2__)
+#if defined(SYSV)
alarm(1);
if ((pidfound = wait(NULL)) == serverpid)
break;
alarm(0);
#else /* SYSV */
-#if defined(SVR4) || defined(_POSIX_SOURCE) || defined(Lynx) || defined(__APPLE__)
+#if defined(SVR4) || defined(_POSIX_SOURCE) || defined(__APPLE__)
if ((pidfound = waitpid(serverpid, &status, WNOHANG)) == serverpid)
break;
#else
@@ -525,9 +465,6 @@ static int
startServer(char *server[])
{
sigset_t mask, old;
-#ifdef __UNIXOS2__
- sigset_t pendings;
-#endif
sigemptyset(&mask);
sigaddset(&mask, SIGUSR1);
@@ -559,9 +496,7 @@ startServer(char *server[])
* prevent server from getting sighup from vhangup()
* if client is xterm -L
*/
-#ifndef __UNIXOS2__
setpgid(0,getpid());
-#endif
Execute (server, environ);
Error ("no server \"%s\" in PATH\n", server[0]);
{
@@ -608,17 +543,6 @@ startServer(char *server[])
*/
alarm (15);
-#ifdef __UNIXOS2__
- /*
- * fg2003/05/06: work around a problem in EMX: sigsuspend()
- * does not deliver pending signals when called but when
- * returning; so if SIGUSR1 has already been sent by the
- * server, we would still have to await SIGALRM
- */
- sigemptyset(&pendings);
- sigpending(&pendings);
- if (!sigismember(&pendings, SIGUSR1))
-#endif /* __UNIXOS2__ */
sigsuspend(&old);
alarm (0);
sigprocmask(SIG_SETMASK, &old, NULL);
@@ -733,11 +657,6 @@ startClient(char *client[])
}
setpgid(0, getpid());
environ = newenviron;
-#ifdef __UNIXOS2__
-#undef environ
- environ = newenviron;
- client[0] = (char*)__XOS2RedirRoot(client[0]);
-#endif
Execute (client,newenviron);
Error ("no program named \"%s\" in PATH\r\n", client[0]);
fprintf (stderr,