Discontinue HPUX support

This commit is contained in:
Chase
2022-07-22 21:42:06 -05:00
committed by Jon Trulson
parent bd83b53d56
commit edf4319548
235 changed files with 198 additions and 6290 deletions

View File

@@ -49,12 +49,6 @@
#include "TermPrimUtil.h"
#include "TermPrimParseTable.h"
#if defined (__hpux)
/*
* On HP MAXINT is defined in both <values.h> and <sys/param.h>
*/
#undef MAXINT
#endif
#if defined(CSRG_BASED)
#define MAXSHORT SHRT_MAX
#else

View File

@@ -75,7 +75,7 @@ extern char * _DtTermPrimGetMessage( char *filename, int set, int n, char *s );
#include <ctype.h>
#include <Dt/MsgCatP.h>
#include <wchar.h>
#if defined(__linux__) || defined(hpV4)
#if defined(__linux__)
# include <sys/types.h> /* For FD_* macros. */
# include <sys/time.h> /* For select() prototype. */
#else
@@ -246,21 +246,12 @@ static XtResource resources[] =
XtOffsetOf(struct _DtTermPrimitiveRec, term.columns),
XmRImmediate, (XtPointer) defaultColumns
},
#ifdef HPVUE
{
DtNbackgroundIsSelect, DtCBackgroundIsSelect, XmRBoolean,
sizeof(Boolean),
XtOffsetOf(struct _DtTermPrimitiveRec, term.backgroundIsSelect),
XtRImmediate, (XtPointer) True
},
#else /* HPVUE */
{
DtNbackgroundIsSelect, DtCBackgroundIsSelect, XmRBoolean,
sizeof(Boolean),
XtOffsetOf(struct _DtTermPrimitiveRec, term.backgroundIsSelect),
XtRImmediate, (XtPointer) False
},
#endif /* HPVUE */
{
XmNtraversalOn, XmCTraversalOn, XmRBoolean, sizeof(Boolean),
XtOffsetOf(struct _DtTermPrimitiveRec, primitive.traversal_on),

View File

@@ -172,7 +172,7 @@ static struct _pty_dirs {
{PTY_null, PTY_null, PTY_null, PTY_null, PTY_null, False},
};
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED)
#if defined(CSRG_BASED)
/* Use openpty() to open Master/Slave pseudo-terminal pair */
/* Current version of openpty() uses non-STREAM device. BSD name space */
#define TTYNAMELEN 25
@@ -273,25 +273,8 @@ GetPty(char **ptySlave, char **ptyMaster)
* This allows us to access the pty when we
* are no longer suid root...
*/
#ifdef HP_ARCHITECTURE
{
struct group *grp;
gid_t gid;
_Xgetgrparams grp_buf;
if (grp = _XGetgrnam("tty", grp_buf)) {
gid = grp->gr_gid;
} else {
gid = 0;
}
(void) endgrent();
(void) chown(ttyDev, getuid(), gid);
(void) chmod(ttyDev, 0620);
}
#else /* HP_ARCHITECTURE */
(void) chown(ttyDev, getuid(), getgid());
(void) chmod(ttyDev, 0622);
#endif /* HP_ARCHITECTURE */
/* close off the pty slave... */
(void) close(ttyFd);
@@ -336,7 +319,7 @@ GetPty(char **ptySlave, char **ptyMaster)
return(-1);
}
#endif /* ALPHA_ARCHITECTURE */
#endif /* BSD */
/* this is a public wrapper around the previous function that runs the
* previous function setuid root...
@@ -358,45 +341,8 @@ _DtTermPrimGetPty(char **ptySlave, char **ptyMaster)
static int
SetupPty(char *ptySlave, int ptyFd)
{
#ifdef HP_ARCHITECTURE
{
struct group *grp;
gid_t gid;
_Xgetgrparams grp_buf;
if (grp = _XGetgrnam("tty", grp_buf)) {
gid = grp->gr_gid;
} else {
gid = 0;
}
(void) endgrent();
(void) chown(ptySlave, getuid(), gid);
(void) chmod(ptySlave, 0620);
}
#else /* HP_ARCHITECTURE */
#ifdef ALPHA_ARCHITECTURE
/* code from xterm to setup ownership and permission */
{
struct group *ttygrp;
_Xgetgrparams grp_buf;
if (ttygrp = _XGetgrnam("tty", grp_buf)) {
/* change ownership of tty to real uid, "tty" gid */
chown (ptySlave, getuid(), ttygrp->gr_gid);
chmod (ptySlave, 0620);
}
else {
/* change ownership of tty to real group and user id */
chown (ptySlave, getuid(), getgid());
chmod (ptySlave, 0622);
}
endgrent();
}
#else /* ALPHA_ARCHITECTURE */
(void) chown(ptySlave, getuid(), getgid());
(void) chmod(ptySlave, 0622);
#endif /* ALPHA_ARCHITECTURE */
#endif /* HP_ARCHITECTURE */
return 0;
}

View File

@@ -34,9 +34,6 @@
#include <errno.h>
#include <signal.h>
#include <Xm/Xm.h>
#ifdef HP_ARCHITECTURE
# define X_INCLUDE_GRP_H
#endif /* HP_ARCHITECTURE */
#define X_INCLUDE_UNISTD_H
#define XOS_USE_XT_LOCKING
#include <X11/Xos_r.h>
@@ -85,25 +82,8 @@ GetPty(char **ptySlave, char **ptyMaster)
(void) close(ttyFd);
/* fix the owner, mode, and group... */
#ifdef HP_ARCHITECTURE
{
struct group *grp;
gid_t gid;
_Xgetgrparams grp_buf;
if (grp = _XGetgrnam("tty", grp_buf)) {
gid = grp->gr_gid;
} else {
gid = 0;
}
(void) endgrent();
(void) chown(*ptySlave, getuid(), gid);
(void) chmod(*ptySlave, 0620);
}
#else /* HP_ARCHITECTURE */
(void) chown(*ptySlave, getuid(), getgid());
(void) chmod(*ptySlave, 0622);
#endif /* HP_ARCHITECTURE */
/* pty master and slave names are already set. Return
* the file descriptor...
@@ -142,25 +122,8 @@ _DtTermPrimGetPty(char **ptySlave, char **ptyMaster)
static int
SetupPty(char *ptySlave, int ptyFd)
{
#ifdef HP_ARCHITECTURE
{
struct group *grp;
gid_t gid;
_Xgetgrparams grp_buf;
if (grp = _XGetgrnam("tty", grp_buf)) {
gid = grp->gr_gid;
} else {
gid = 0;
}
(void) endgrent();
(void) chown(ptySlave, getuid(), gid);
(void) chmod(ptySlave, 0620);
}
#else /* HP_ARCHITECTURE */
(void) chown(ptySlave, getuid(), getgid());
(void) chmod(ptySlave, 0622);
#endif /* HP_ARCHITECTURE */
}
int

View File

@@ -63,32 +63,6 @@
#ifndef _Dt_TermPrimOSDepI_h
#define _Dt_TermPrimOSDepI_h
#ifdef ALPHA_ARCHITECTURE
# define USE_TIOCCONS /* use tioccons for -C */
# define HAS_SETEUID /* seteuid available */
# define HAS_SETREUID /* setreuid available */
# define USE_PTYS /* use ptys */
# define USE_TCSBRK /* use TCSBRK ioctl() */
#endif /* ALPHA_ARCHITECTURE */
#ifdef HP_ARCHITECTURE
# define XOR_CAPS_LOCK /* xor caps lock and shift */
# define USE_TIOCCONS /* use tioccons for -C */
# define SETENV_LINES_AND_COLS /* set $LINES and $COLUMNS */
# define HAS_SETRESUID /* setresuid available */
# if OSMAJORVERSION > 9
# define USE_STREAMS /* use streams */
# define USE_CSWIDTH /* use the csWidth resource to */
/* initialize multi-byte processing */
/* in ldterm */
# define USE_TCSENDBREAK /* use tiocbreak() */
# else /* OSMAJORVERSION > 9 */
# define USE_PTYS /* use ptys */
# define USE_TIOCBREAK /* use TIOCBREAK ioctl() */
# endif /* OSMAJORVERSION > 9 */
#endif /* HP_ARCHITECTURE */
#ifdef LINUX_ARCHITECTURE
# define USE_TIOCCONS /* use tioccons for -C */
# define HAS_SETEUID /* seteuid available */

View File

@@ -37,12 +37,6 @@
#include "TermPrimParserP.h"
#include "TermPrimBuffer.h"
#if defined (__hpux)
/*
* On HP MAXINT is defined in both <values.h> and <sys/param.h>
*/
#undef MAXINT
#endif
#if defined(CSRG_BASED)
#define MAXINT INT_MAX
#else

View File

@@ -36,19 +36,7 @@
#include "TermPrimDebug.h"
#include <fcntl.h>
#ifdef ALPHA_ARCHITECTURE
#include <sys/ioctl.h>
#include <sys/ttydev.h>
#endif /* ALPHA_ARCHITECTURE */
#include <termios.h>
#ifdef USE_PTYS
#ifdef HP_ARCHITECTURE
#include <sys/ptyio.h>
#endif /* HP_ARCHITECTURE */
#endif /* USE_PTYS */
#if defined(HP_ARCHITECTURE) && !(OSMAJORVERSION > 9)
#include <bsdtty.h>
#endif /* defined(HP_ARCHITECTURE) && !(OSMAJORVERSION > 9) */
#if defined (USE_SETCSMAP)
#include <langinfo.h>
@@ -571,40 +559,7 @@ _DtTermPrimPtyInit
TMODE (XTTYMODE_eof, tio.c_cc[VEOF]);
TMODE (XTTYMODE_eol, tio.c_cc[VEOL]);
#if defined(HP_ARCHITECTURE)
TMODE (XTTYMODE_swtch, tio.c_cc[VSWTCH]);
TMODE (XTTYMODE_susp, tio.c_cc[VSUSP]);
#if OSMAJORVERSION > 9
/* HP-UX 10.0 supports the new, extended c_cc[] array...
*/
TMODE (XTTYMODE_start, tio.c_cc[VSTART]);
TMODE (XTTYMODE_stop, tio.c_cc[VSTOP]);
TMODE (XTTYMODE_dsusp, tio.c_cc[VDSUSP]);
#ifdef NOTDEF
/* the following two parameters are not supported by
* HP-UX 10.0.
*/
TMODE (XTTYMODE_rprnt, tio.c_cc[VREPRINT]);
TMODE (XTTYMODE_flush, tio.c_cc[VDISCARD]);
#endif /* NOTDEF */
TMODE (XTTYMODE_weras, tio.c_cc[VWERASE]);
TMODE (XTTYMODE_lnext, tio.c_cc[VLNEXT]);
#else /* OSMAJORVERSION > 9 */
{
/* With HP-UX 9.0 (and earlier) we need to set dsuspc
* via the ltchars array. In addition, we have no support
* for rprnt, flush, weras, and lnext...
*/
struct ltchars ltc;
if (!ioctl(pty, TIOCGLTC, &ltc)) {
TMODE (XTTYMODE_dsusp, ltc.t_dsuspc);
(void) ioctl(pty, TIOCSLTC, &ltc);
}
}
#endif /* OSMAJORVERSION > 9 */
#elif defined(IBM_ARCHITECTURE)
#if defined(IBM_ARCHITECTURE)
TMODE (XTTYMODE_start, tio.c_cc[VSTRT]);
TMODE (XTTYMODE_stop, tio.c_cc[VSTOP]);
TMODE (XTTYMODE_susp, tio.c_cc[VSUSP]);
@@ -625,15 +580,6 @@ _DtTermPrimPtyInit
TMODE (XTTYMODE_weras, tio.c_cc[VWERASE]);
TMODE (XTTYMODE_lnext, tio.c_cc[VLNEXT]);
#elif defined(ALPHA_ARCHITECTURE)
TMODE (XTTYMODE_start, tio.c_cc[VSTART]);
TMODE (XTTYMODE_stop, tio.c_cc[VSTOP]);
TMODE (XTTYMODE_susp, tio.c_cc[VSUSP]);
TMODE (XTTYMODE_dsusp, tio.c_cc[VDSUSP]);
TMODE (XTTYMODE_rprnt, tio.c_cc[VREPRINT]);
TMODE (XTTYMODE_flush, tio.c_cc[VDISCARD]);
TMODE (XTTYMODE_weras, tio.c_cc[VWERASE]);
TMODE (XTTYMODE_lnext, tio.c_cc[VLNEXT]);
#endif
}
#undef TMODE

View File

@@ -69,11 +69,6 @@
#define UT_NO_pututline
#endif /* sun */
#ifdef __hpux
#define UT_HOST ut_host
#define UT_ADDR ut_addr
#endif /* __hpux */
#ifdef __AIX
#define UT_HOST ut_host
#define UT_NO_pututline
@@ -362,24 +357,10 @@ UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
if (NULL == (utPtr = getutline(&ut))) {
/* build a base utmp entry... */
utPtr = &ut;
#ifdef __hpux
if (c = strstr(utmpLine, "tty")) {
c += strlen("tty");
} else if (c = strstr(utmpLine, "pts")) {
c += strlen("pts");
} else {
c = utmpLine;
if (strlen(utmpLine) > sizeof(utPtr->ut_id)) {
c += strlen(utmpLine) - sizeof(utPtr->ut_id);
}
}
(void) strncpy(utPtr->ut_id, c, sizeof(utPtr->ut_id));
#else /* __hpux */
#if defined(__AIX)
(void) strncpy(utPtr->ut_id, utmpLine,
sizeof(utPtr->ut_id));
#else /* __AIX */
#if defined(__linux__) || defined(sun)
#elif defined(__linux__) || defined(sun)
if (c = strchr(utmpLine, '/')) {
c++;
} else {
@@ -389,8 +370,6 @@ UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
#else /* linux || sun */
error out -- missing code for utPtr->ut_id
#endif /* sun */
#endif /* __AIX */
#endif /* __hpux */
}
/* set up the new entry... */

View File

@@ -32,10 +32,10 @@
#include "TermHeader.h"
#include <fcntl.h>
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
/* For TIOCSTTY definitions */
#include <sys/ioctl.h>
#endif /* ALPHA_ARCHITECTURE */
#endif /* BSD || Linux */
#include <sys/wait.h>
#include <signal.h>
@@ -301,11 +301,6 @@ _DtTermPrimSubprocExec(Widget w,
_Xgetpwparams pw_buf;
_Xgetloginparams login_buf;
#ifdef ALPHA_ARCHITECTURE
/* merge code from xterm, ignore so that TIOCSWINSZ doesn't block */
signal(SIGTTOU, SIG_IGN);
#endif /* ALPHA_ARCHITECTURE */
/* build a default exec command and argv list if one wasn't supplied...
*/
/* cmd... */
@@ -456,13 +451,13 @@ _DtTermPrimSubprocExec(Widget w,
/* child...
*/
_DtTermProcessUnlock();
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
/* establish a new session for child */
setsid();
#else
/* do a setpgrp() so that we can... */
(void) setpgrp();
#endif /* ALPHA_ARCHITECTURE */
#endif /* Linux || BSD */
#if defined(LINUX_ARCHITECTURE)
/* set the ownership and mode of the pty... */
@@ -477,7 +472,7 @@ _DtTermPrimSubprocExec(Widget w,
(void) _exit(1);
}
#if defined(ALPHA_ARCHITECTURE) || defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
/* BSD needs to do this to acquire pty as controlling terminal */
if (ioctl(pty, TIOCSCTTY, (char *)NULL) < 0) {
(void) close(pty);
@@ -488,7 +483,7 @@ _DtTermPrimSubprocExec(Widget w,
/* Do it when no controlling terminal doesn't work for OSF/1 */
_DtTermPrimPtyGetDefaultModes();
#endif /* ALPHA_ARCHITECTURE */
#endif /* Linux || BSD */
#if !defined(LINUX_ARCHITECTURE)
/* set the ownership and mode of the pty... */