summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amade@asmblr.net>2012-01-10 21:34:35 +0100
committerAmadeusz Sławiński <amade@asmblr.net>2014-07-24 11:50:47 +0200
commitce4a64919e275b0646cab0bf25c99239f09fec76 (patch)
tree803d1c72ddc970d6e100a7288c0e89716cb0bcd7
parent030b3b2509c1d7172b962928c8385c1d898cfe81 (diff)
downloadscreen-ce4a64919e275b0646cab0bf25c99239f09fec76.tar.gz
Remove more 'compatibility' stuff
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
-rw-r--r--src/acconfig.h13
-rw-r--r--src/configure.in14
-rw-r--r--src/extern.h5
-rw-r--r--src/loadav.c243
-rw-r--r--src/misc.c22
-rw-r--r--src/os.h15
-rw-r--r--src/pty.c255
-rw-r--r--src/sched.c37
-rw-r--r--src/screen.c4
-rw-r--r--src/socket.c36
-rw-r--r--src/tty.sh4
-rw-r--r--src/utmp.c18
12 files changed, 2 insertions, 664 deletions
diff --git a/src/acconfig.h b/src/acconfig.h
index 9adb29d..f72936a 100644
--- a/src/acconfig.h
+++ b/src/acconfig.h
@@ -228,13 +228,6 @@
*
*/
-/*
- * Some defines to identify special unix variants
- */
-#ifndef SVR4
-#undef SVR4
-#endif
-
/* #ifndef __osf__ */
#ifndef MIPS
#undef MIPS
@@ -467,12 +460,6 @@
*/
#undef HAVE_DEV_PTC
-/*
- * define HAVE_SVR4_PTYS if you have a /dev/ptmx character special
- * device and support the ptsname(), grantpt(), unlockpt() functions.
- */
-#undef HAVE_SVR4_PTYS
-
/*
* define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
* to unusual environments. E.g. For SunOs the defaults are "qpr" and
diff --git a/src/configure.in b/src/configure.in
index 48adc10..be8d6ea 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -205,13 +205,6 @@ AC_TRY_LINK([#include <utmpx.h>
,LIBS="$oldlibs")
AC_CHECK_HEADERS([stropts.h string.h strings.h])
-AC_CHECKING(for Solaris 2.x)
-AC_EGREP_CPP(yes,
-[#if defined(SVR4) && defined(sun)
- yes
-#endif
-], LIBS="$LIBS -lsocket -lnsl -lkstat")
-
dnl
dnl **** typedefs ****
dnl
@@ -692,13 +685,6 @@ if test -r /dev/ptc; then
AC_DEFINE(HAVE_DEV_PTC)
fi
-AC_CHECKING(for SVR4 ptys)
-sysvr4ptys=
-if test -c /dev/ptmx ; then
-AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
-sysvr4ptys=1])
-fi
-
AC_CHECK_FUNCS(getpt)
dnl check for openpty()
diff --git a/src/extern.h b/src/extern.h
index 24d4ae1..92627c6 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -609,10 +609,6 @@ extern struct winsize glwz;
extern int separate_sids;
#endif
-# if defined(GETUTENT) && (!defined(SVR4) || defined(__hpux)) && ! defined(__CYGWIN__)
-# if defined(hpux) /* cruel hpux release 8.0 */
-# define pututline _pututline
-# endif /* hpux */
extern struct utmp *getutline(), *pututline();
# if defined(_SEQUENT_)
extern struct utmp *ut_add_user(), *ut_delete_user();
@@ -621,5 +617,4 @@ extern char *ut_find_host();
# define UTHOST /* _SEQUENT_ has ut_find_host() */
# endif
# endif /* _SEQUENT_ */
-# endif /* GETUTENT && !SVR4 */
diff --git a/src/loadav.c b/src/loadav.c
index 5948909..ab9e125 100644
--- a/src/loadav.c
+++ b/src/loadav.c
@@ -28,38 +28,17 @@
#include <sys/types.h>
#include <fcntl.h>
-#ifdef ultrix
-# include <sys/fixpoint.h>
-#endif
-
-/* mach stuff included here to prevent index macro conflict */
-#ifdef NeXT
-# include <sys/version.h>
-# if KERNEL_MAJOR_VERSION > 2
-# include <mach/mach.h>
-# else
-# include <mach.h>
-# endif
-#endif
#include "config.h"
#include "screen.h"
#include "extern.h"
-#ifdef LOADAV
-
static int GetLoadav (void);
static LOADAV_TYPE loadav[LOADAV_NUM];
static int loadok;
-
-
-/***************************************************************/
-
-#if defined(linux) && !defined(LOADAV_DONE)
-#define LOADAV_DONE
/*
* This is the easy way. It relies in /proc being mounted.
* For the big and ugly way refer to previous screen version.
@@ -112,227 +91,6 @@ GetLoadav()
}
return i;
}
-#endif /* linux */
-
-/***************************************************************/
-
-#if defined(LOADAV_GETLOADAVG) && !defined(LOADAV_DONE)
-#define LOADAV_DONE
-void
-InitLoadav()
-{
- loadok = 1;
-}
-
-static int
-GetLoadav()
-{
- return getloadavg(loadav, LOADAV_NUM);
-}
-#endif
-
-/***************************************************************/
-
-#if defined(apollo) && !defined(LOADAV_DONE)
-#define LOADAV_DONE
-void
-InitLoadav()
-{
- loadok = 1;
-}
-
-static int
-GetLoadav()
-{
- proc1_$get_loadav(loadav);
- return LOADAV_NUM;
-}
-#endif
-
-/***************************************************************/
-
-#if defined(NeXT) && !defined(LOADAV_DONE)
-#define LOADAV_DONE
-
-static processor_set_t default_set;
-
-void
-InitLoadav()
-{
- kern_return_t error;
-
- error = processor_set_default(host_self(), &default_set);
- if (error != KERN_SUCCESS)
- mach_error("Error calling processor_set_default", error);
- else
- loadok = 1;
-}
-
-static int
-GetLoadav()
-{
- unsigned int info_count;
- struct processor_set_basic_info info;
- host_t host;
-
- info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
- if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host, (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
- return 0;
- loadav[0] = (float)info.load_average / LOAD_SCALE;
- return 1;
-}
-#endif
-
-/***************************************************************/
-
-#if defined(sun) && defined(SVR4) && !defined(LOADAV_DONE)
-#define LOADAV_DONE
-
-#include <kstat.h>
-
-static kstat_ctl_t *kc;
-
-void
-InitLoadav()
-{
- loadok = (kc = kstat_open()) != 0;
-}
-
-static int
-GetLoadav()
-{
- kstat_t *ks;
- kstat_named_t *avgs[3];
- int i;
-
- kstat_chain_update(kc);
- if ((ks = kstat_lookup(kc, "unix", -1, "system_misc")) == 0 || kstat_read(kc, ks, (void *)0) == -1)
- return (loadok = 0);
- avgs[0] = kstat_data_lookup(ks, "avenrun_1min");
- avgs[1] = kstat_data_lookup(ks, "avenrun_5min");
- avgs[2] = kstat_data_lookup(ks, "avenrun_15min");
- for (i = 0; i < 3; i++)
- {
- if (avgs[i] == 0 || avgs[i]->data_type != KSTAT_DATA_ULONG)
- return (loadok = 0);
- loadav[i] = avgs[i]->value.ul;
- }
- return 3;
-}
-
-#endif
-
-/***************************************************************/
-
-#if defined(__osf__) && defined(__alpha) && !defined(LOADAV_DONE)
-#define LOADAV_DONE
-
-struct rtentry; struct mbuf; /* shut up gcc on OSF/1 4.0 */
-#include <sys/table.h>
-
-void
-InitLoadav()
-{
- loadok = 1;
-}
-
-static int
-GetLoadav()
-{
- struct tbl_loadavg tbl;
- int i;
-
- if (table(TBL_LOADAVG, 0, &tbl, 1, sizeof(struct tbl_loadavg)) != 1)
- return 0;
-
- if (tbl.tl_lscale)
- {
- /* in long */
- for (i = 0; i < LOADAV_NUM; i++)
- loadav[i] = (double) tbl.tl_avenrun.l[i] / tbl.tl_lscale;
- }
- else
- {
- /* in double */
- for (i = 0; i < LOADAV_NUM; i++)
- loadav[i] = tbl.tl_avenrun.d[i];
- }
- return LOADAV_NUM;
-}
-#endif
-
-/***************************************************************/
-
-#if !defined(LOADAV_DONE)
-/*
- * The old fashion way: open kernel and read avenrun
- *
- * Header File includes
- */
-
-# ifdef NLIST_STRUCT
-# include <nlist.h>
-# else
-# include <a.out.h>
-# endif
-# ifndef NLIST_DECLARED
-extern int nlist (char *, struct nlist *);
-# endif
-
-#ifdef LOADAV_USE_NLIST64
-# define nlist nlist64
-#endif
-
-static struct nlist nl[2];
-static int kmemf;
-
-#ifdef _IBMR2
-# define nlist(u,l) knlist(l,1,sizeof(*l))
-#endif
-
-void
-InitLoadav()
-{
- debug("Init Kmem...\n");
- if ((kmemf = open("/dev/kmem", O_RDONLY)) == -1)
- return;
-# if !defined(_AUX_SOURCE) && !defined(AUX)
-# ifdef NLIST_NAME_UNION
- nl[0].n_un.n_name = LOADAV_AVENRUN;
-# else
- nl[0].n_name = LOADAV_AVENRUN;
-# endif
-# else
- strncpy(nl[0].n_name, LOADAV_AVENRUN, sizeof(nl[0].n_name));
-# endif
- debug2("Searching in %s for %s\n", LOADAV_UNIX, nl[0].n_name);
- nlist(LOADAV_UNIX, nl);
- if (nl[0].n_value == 0)
- {
- close(kmemf);
- return;
- }
-# if 0 /* no longer needed (Al.Smith@aeschi.ch.eu.org) */
-# ifdef sgi
- nl[0].n_value &= (unsigned long)-1 >> 1; /* clear upper bit */
-# endif /* sgi */
-# endif
- debug1("AvenrunSym found (0x%lx)!!\n", nl[0].n_value);
- loadok = 1;
-}
-
-static int
-GetLoadav()
-{
- if (lseek(kmemf, (off_t) nl[0].n_value, 0) == (off_t)-1)
- return 0;
- if (read(kmemf, (char *) loadav, sizeof(loadav)) != sizeof(loadav))
- return 0;
- return LOADAV_NUM;
-}
-#endif
-
-/***************************************************************/
#ifndef FIX_TO_DBL
#define FIX_TO_DBL(l) ((double)(l) / LOADAV_SCALE)
@@ -352,4 +110,3 @@ AddLoadav(char *p)
}
}
-#endif /* LOADAV */
diff --git a/src/misc.c b/src/misc.c
index 20def3b..e74833a 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -34,10 +34,6 @@
#include "screen.h"
#include "extern.h"
-#ifdef SVR4
-# include <sys/resource.h>
-#endif
-
#ifdef HAVE_FDWALK
static int close_func (void *, int);
#endif
@@ -142,28 +138,10 @@ Filename(char *s)
char *
stripdev(char *nam)
{
-#ifdef apollo
- char *p;
-
- if (nam == NULL)
- return NULL;
-# ifdef SVR4
- /* unixware has /dev/pts012 as synonym for /dev/pts/12 */
- if (!strncmp(nam, "/dev/pts", 8) && nam[8] >= '0' && nam[8] <= '9')
- {
- static char b[13];
- sprintf(b, "pts/%d", atoi(nam + 8));
- return b;
- }
-# endif /* SVR4 */
- if (p = strstr(nam,"/dev/"))
- return p + 5;
-#else /* apollo */
if (nam == NULL)
return NULL;
if (strncmp(nam, "/dev/", 5) == 0)
return nam + 5;
-#endif /* apollo */
return nam;
}
diff --git a/src/os.h b/src/os.h
index 92d8979..09879ca 100644
--- a/src/os.h
+++ b/src/os.h
@@ -221,10 +221,6 @@
*
* For this simple reason I now favour O_NDELAY. jw. 4.5.95
*/
-#if defined(sun) && !defined(SVR4)
-# undef O_NONBLOCK
-#endif
-
#if !defined(O_NONBLOCK) && defined(O_NDELAY)
# define O_NONBLOCK O_NDELAY
#endif
@@ -268,9 +264,7 @@
* Wait stuff
*/
-#if (!defined(sysV68) && !defined(M_XENIX)) || defined(NeXT) || defined(M_UNIX)
# include <sys/wait.h>
-#endif
#ifndef WTERMSIG
# ifndef BSDWAIT /* if wait is NOT a union: */
@@ -309,15 +303,6 @@
# endif
#endif
-
-/*****************************************************************
- * select stuff
- */
-
-#if defined(M_XENIX) || defined(M_UNIX) || defined(_SEQUENT_)
-#include <sys/select.h> /* for timeval + FD... */
-#endif
-
/*****************************************************************
* user defineable stuff
*/
diff --git a/src/pty.c b/src/pty.c
index 876d7b1..79bacb7 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -41,11 +41,7 @@
# include <sys/stropts.h>
#endif
-#ifdef ISC
-# include <sys/tty.h>
-# include <sys/sioctl.h>
-# include <sys/pty.h>
-#endif
+#include <pty.h>
#include "extern.h"
@@ -59,23 +55,7 @@
# define PTYRANGE1 "0123456789abcdef"
#endif
-/* SVR4 pseudo ttys don't seem to work with SCO-5 */
-#ifdef M_UNIX
-# undef HAVE_SVR4_PTYS
-#endif
-
-/* used for opening a new pty-pair: */
-static char PtyName[32], TtyName[32];
-
-#if !(defined(sequent) || defined(_SEQUENT_) || defined(HAVE_SVR4_PTYS))
-# ifdef M_UNIX
-static char PtyProto[] = "/dev/ptypXY";
-static char TtyProto[] = "/dev/ttypXY";
-# else
-static char PtyProto[] = "/dev/ptyXY";
-static char TtyProto[] = "/dev/ttyXY";
-# endif
-#endif
+static char TtyName[32];
static void initmaster (int);
@@ -105,184 +85,8 @@ InitPTY(int f)
{
if (f < 0)
return;
-#if defined(I_PUSH) && defined(HAVE_SVR4_PTYS) && !defined(sgi) && !defined(linux) && !defined(__GLIBC__) && !defined(__osf__) && !defined(M_UNIX)
- if (ioctl(f, I_PUSH, "ptem"))
- Panic(errno, "InitPTY: cannot I_PUSH ptem");
- if (ioctl(f, I_PUSH, "ldterm"))
- Panic(errno, "InitPTY: cannot I_PUSH ldterm");
-# ifdef sun
- if (ioctl(f, I_PUSH, "ttcompat"))
- Panic(errno, "InitPTY: cannot I_PUSH ttcompat");
-# endif
-#endif
-}
-
-/***************************************************************/
-
-#if defined(OSX) && !defined(PTY_DONE)
-#define PTY_DONE
-int
-OpenPTY(char **ttyn)
-{
- register int f;
- if ((f = open_controlling_pty(TtyName)) < 0)
- return -1;
- initmaster(f);
- *ttyn = TtyName;
- return f;
-}
-#endif
-
-/***************************************************************/
-
-#if (defined(sequent) || defined(_SEQUENT_)) && !defined(PTY_DONE)
-#define PTY_DONE
-int
-OpenPTY(char **ttyn)
-{
- char *m, *s;
- register int f;
-
- if ((f = getpseudotty(&s, &m)) < 0)
- return -1;
-#ifdef _SEQUENT_
- fvhangup(s);
-#endif
- strncpy(PtyName, m, sizeof(PtyName));
- strncpy(TtyName, s, sizeof(TtyName));
- initmaster(f);
- *ttyn = TtyName;
- return f;
-}
-#endif
-
-/***************************************************************/
-
-#if defined(__sgi) && !defined(PTY_DONE)
-#define PTY_DONE
-int
-OpenPTY(char **ttyn)
-{
- int f;
- char *name, *_getpty();
- void (*sigcld)(int);
-
- /*
- * SIGCHLD set to SIG_DFL for _getpty() because it may fork() and
- * exec() /usr/adm/mkpts
- */
- sigcld = signal(SIGCHLD, SIG_DFL);
- name = _getpty(&f, O_RDWR | O_NONBLOCK, 0600, 0);
- signal(SIGCHLD, sigcld);
-
- if (name == 0)
- return -1;
- initmaster(f);
- *ttyn = name;
- return f;
-}
-#endif
-
-/***************************************************************/
-
-#if defined(MIPS) && defined(HAVE_DEV_PTC) && !defined(PTY_DONE)
-#define PTY_DONE
-int
-OpenPTY(char **ttyn)
-{
- register int f;
- struct stat buf;
-
- strncpy(PtyName, "/dev/ptc", 32);
- if ((f = open(PtyName, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0)
- return -1;
- if (fstat(f, &buf) < 0)
- {
- close(f);
- return -1;
- }
- sprintf(TtyName, "/dev/ttyq%d", minor(buf.st_rdev));
- initmaster(f);
- *ttyn = TtyName;
- return f;
-}
-#endif
-
-/***************************************************************/
-
-#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE)
-#define PTY_DONE
-int
-OpenPTY(char **ttyn)
-{
- register int f;
- char *m, *ptsname();
- int unlockpt (int), grantpt (int);
-#if defined(HAVE_GETPT) && defined(linux)
- int getpt (void);
-#endif
- void (*sigcld)(int);
-
- strncpy(PtyName, "/dev/ptmx", 32);
-#if defined(HAVE_GETPT) && (defined(linux) || defined(__GLIBC__))
- if ((f = getpt()) == -1)
-#else
- if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
-#endif
- return -1;
-
- /*
- * SIGCHLD set to SIG_DFL for grantpt() because it fork()s and
- * exec()s pt_chmod
- */
- sigcld = signal(SIGCHLD, SIG_DFL);
- if ((m = ptsname(f)) == NULL || grantpt(f) || unlockpt(f))
- {
- signal(SIGCHLD, sigcld);
- close(f);
- return -1;
- }
- signal(SIGCHLD, sigcld);
- strncpy(TtyName, m, sizeof(TtyName));
- initmaster(f);
- *ttyn = TtyName;
- return f;
-}
-#endif
-
-/***************************************************************/
-
-#if defined(_AIX) && defined(HAVE_DEV_PTC) && !defined(PTY_DONE)
-#define PTY_DONE
-
-int
-OpenPTY(char **ttyn)
-{
- register int f;
-
- /* a dumb looking loop replaced by mycrofts code: */
- strncpy (PtyName, "/dev/ptc", 32);
- if ((f = open (PtyName, O_RDWR | O_NOCTTY)) < 0)
- return -1;
- strncpy(TtyName, ttyname(f), sizeof(TtyName));
- if (eff_uid && access(TtyName, R_OK | W_OK))
- {
- close(f);
- return -1;
- }
- initmaster(f);
-# ifdef _IBMR2
- pty_preopen = 1;
-# endif
- *ttyn = TtyName;
- return f;
}
-#endif
-
-/***************************************************************/
-#if defined(HAVE_OPENPTY) && !defined(PTY_DONE)
-#define PTY_DONE
int
OpenPTY(char **ttyn)
{
@@ -295,59 +99,4 @@ OpenPTY(char **ttyn)
*ttyn = TtyName;
return f;
}
-#endif
-
-/***************************************************************/
-
-#ifndef PTY_DONE
-int
-OpenPTY(char **ttyn)
-{
- register char *p, *q, *l, *d;
- register int f;
-
- debug("OpenPTY: Using BSD style ptys.\n");
- strncpy(PtyName, PtyProto, 32);
- strncpy(TtyName, TtyProto, 32);
- for (p = PtyName; *p != 'X'; p++)
- ;
- for (q = TtyName; *q != 'X'; q++)
- ;
- for (l = PTYRANGE0; (*p = *l) != '\0'; l++)
- {
- for (d = PTYRANGE1; (p[1] = *d) != '\0'; d++)
- {
- debug1("OpenPTY tries '%s'\n", PtyName);
- if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
- continue;
- q[0] = *l;
- q[1] = *d;
- if (eff_uid && access(TtyName, R_OK | W_OK))
- {
- close(f);
- continue;
- }
-#if defined(sun) && defined(TIOCGPGRP) && !defined(SUNOS3)
- /* Hack to ensure that the slave side of the pty is
- * unused. May not work in anything other than SunOS4.1
- */
- {
- int pgrp;
-
- /* tcgetpgrp does not work (uses TIOCGETPGRP)! */
- if (ioctl(f, TIOCGPGRP, (char *)&pgrp) != -1 || errno != EIO)
- {
- close(f);
- continue;
- }
- }
-#endif
- initmaster(f);
- *ttyn = TtyName;
- return f;
- }
- }
- return -1;
-}
-#endif
diff --git a/src/sched.c b/src/sched.c
index d9b5841..09583dd 100644
--- a/src/sched.c
+++ b/src/sched.c
@@ -42,9 +42,6 @@ static struct event *nextev;
static int calctimeout;
static struct event *calctimo (void);
-#if (defined(sgi) && defined(SVR4)) || defined(__osf__) || defined(M_UNIX)
-static int sgihack (void);
-#endif
void
evenq(struct event *ev)
@@ -189,10 +186,6 @@ sched()
{
if (errno != EINTR)
{
-#if defined(sgi) && defined(SVR4)
- if (errno == EIO && sgihack())
- continue;
-#endif
#if defined(__osf__) || defined(M_UNIX)
/* OSF/1 3.x, SCO bug: EBADF */
/* OSF/1 4.x bug: EIO */
@@ -254,33 +247,3 @@ SetTimeout(struct event *ev, int timo)
calctimeout = 1;
}
-
-#if (defined(sgi) && defined(SVR4)) || defined(__osf__) || defined(M_UNIX)
-
-extern struct display *display, *displays;
-static int sgihack()
-{
- fd_set r, w;
- struct timeval tv;
-
- debug("IRIX5.2 workaround: searching for bad display\n");
- for (display = displays; display; )
- {
- FD_ZERO(&r);
- FD_ZERO(&w);
- FD_SET(D_userfd, &r);
- FD_SET(D_userfd, &w);
- tv.tv_sec = tv.tv_usec = 0;
- if (select(FD_SETSIZE, &r, &w, (fd_set *)0, &tv) == -1)
- {
- if (errno == EINTR)
- continue;
- Hangup(); /* goodbye display */
- return 1;
- }
- display = display->d_next;
- }
- return 0;
-}
-
-#endif
diff --git a/src/screen.c b/src/screen.c
index 32ee377..0f1231b 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -52,10 +52,6 @@
# include <sys/stropts.h>
#endif
-#if defined(sequent) || defined(SVR4)
-# include <sys/resource.h>
-#endif /* sequent || SVR4 */
-
#ifdef ISC
# include <sys/tty.h>
# include <sys/sioctl.h>
diff --git a/src/socket.c b/src/socket.c
index dcca395..b50950e 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -798,10 +798,6 @@ CreateTempDisplay(struct msg *m, int recvfd, struct win *win)
if (attach)
Kill(pid, SIGCONT);
-#if defined(ultrix) || defined(pyr) || defined(NeXT)
- brktty(i); /* for some strange reason this must be done */
-#endif
-
if (attach)
{
if (display || win)
@@ -1125,28 +1121,6 @@ ReceiveRaw(int s)
close(s);
}
-#if defined(_SEQUENT_) && !defined(NAMEDPIPE)
-#undef connect
-/*
- * sequent_ptx socket emulation must have mode 000 on the socket!
- */
-static int
-sconnect(int s, struct sockaddr *sapp, int len)
-{
- register struct sockaddr_un *sap;
- struct stat st;
- int x;
-
- sap = (struct sockaddr_un *)sapp;
- if (stat(sap->sun_path, &st))
- return -1;
- chmod(sap->sun_path, 0);
- x = connect(s, (struct sockaddr *) sap, len);
- chmod(sap->sun_path, st.st_mode);
- return x;
-}
-#endif
-
/*
* Set the mode bits of the socket to the current status
@@ -1215,16 +1189,6 @@ FinishAttach(struct msg *m)
)
FinishDetach(m);
-#if defined(pyr) || defined(xelos) || defined(sequent)
- /*
- * Kludge for systems with braindamaged termcap routines,
- * which evaluate $TERMCAP, regardless weather it describes
- * the correct terminal type or not.
- */
- debug("unsetenv(TERMCAP) in case of a different terminal");
- unsetenv("TERMCAP");
-#endif
-
/*
* We reboot our Terminal Emulator. Forget all we knew about
* the old terminal, reread the termcap entries in .screenrc
diff --git a/src/tty.sh b/src/tty.sh
index 8de7b89..b8cb5e9 100644
--- a/src/tty.sh
+++ b/src/tty.sh
@@ -84,10 +84,6 @@ exit 0
#include "screen.h"
#include "extern.h"
-#if !defined(TIOCCONS) && defined(sun) && defined(SVR4)
-# include <sys/strredir.h>
-#endif
-
#if (!defined(TIOCCONS) && defined(SRIOCSREDIR)) || defined(linux)
static void consredir_readev_fn (struct event *, char *);
#endif
diff --git a/src/utmp.c b/src/utmp.c
index 69b5c58..5c6ba48 100644
--- a/src/utmp.c
+++ b/src/utmp.c
@@ -61,16 +61,6 @@
#endif
-/*
- * we have a suid-root helper app that changes the utmp for us
- * (won't work for login-slots)
- */
-#if (defined(sun) && defined(SVR4) && defined(GETUTENT)) || defined(HAVE_UTEMPTER)
-# define UTMP_HELPER
-#endif
-
-
-
#ifdef UTMPOK
@@ -447,9 +437,7 @@ SetUtmp(struct win *win)
sprintf(host + strlen(host), ":S.%d", win->w_number);
debug1("rlogin hostname: '%s'\n", host);
-# if !defined(_SEQUENT_) && !defined(sequent)
strncpy(u.ut_host, host, sizeof(u.ut_host));
-# endif
#endif /* UTHOST */
if (pututslot(slot, &u, host, win) == 0)
@@ -568,9 +556,7 @@ makedead(struct utmp *u)
u->ut_exit.e_termination = 0;
u->ut_exit.e_exit = 0;
#endif
-#if !defined(sun) || !defined(SVR4)
u->ut_user[0] = 0; /* for Digital UNIX, kilbi@rad.rwth-aachen.de */
-#endif
}
static void
@@ -662,10 +648,6 @@ getutslot(slot_t slot)
static int
pututslot(slot_t slot, struct utmp *u, char *host, struct win *win)
{
-#ifdef sequent
- if (SLOT_USED(u))
- return add_utmp(slot, u) != -1;
-#endif
if (utmpfd < 0 && !initutmp())
return 0;
lseek(utmpfd, (off_t)(slot * sizeof(*u)), 0);