From 030b3b2509c1d7172b962928c8385c1d898cfe81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Tue, 10 Jan 2012 20:41:26 +0100 Subject: More removal, mainly SYSV SYSVSIGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Amadeusz Sławiński --- src/acconfig.h | 13 ------------- src/configure.in | 45 --------------------------------------------- src/misc.c | 11 ----------- src/os.h | 24 +----------------------- src/screen.c | 43 +------------------------------------------ src/screen.h | 20 -------------------- src/tty.sh | 26 -------------------------- 7 files changed, 2 insertions(+), 180 deletions(-) diff --git a/src/acconfig.h b/src/acconfig.h index eff9ea0..9adb29d 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -294,13 +294,6 @@ */ #undef NEED_OSPEED -/* - * Define SYSV if your machine is SYSV complient (Sys V, HPUX, A/UX) - */ -#ifndef SYSV -#undef SYSV -#endif - /* * Define SIGVOID if your signal handlers return void. On older * systems, signal returns int, but on newer ones, it returns void. @@ -312,12 +305,6 @@ */ #undef USESIGSET -/* - * Define SYSVSIGS if signal handlers must be reinstalled after - * they have been called. - */ -#undef SYSVSIGS - /* * Define BSDWAIT if your system defines a 'union wait' in * diff --git a/src/configure.in b/src/configure.in index bb34037..48adc10 100644 --- a/src/configure.in +++ b/src/configure.in @@ -188,12 +188,6 @@ main () { ], AC_NOTE(- you have a POSIX system) AC_DEFINE(POSIX) posix=1) fi -AC_CHECKING(for System V) -AC_TRY_COMPILE( -[#include -#include -#include ], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV)) - AC_CHECKING(for sequent/ptx) AC_EGREP_CPP(yes, [#ifdef _SEQUENT_ @@ -250,12 +244,8 @@ AC_TRY_LINK( tcsetpgrp(0, 0); #else int x = TIOCSPGRP; -#ifdef SYSV -setpgrp(); -#else int y = TIOCNOTTY; #endif -#endif ], AC_NOTE(- you have jobcontrol) AC_DEFINE(BSDJOBS), AC_NOTE(- you don't have jobcontrol)) dnl @@ -1068,41 +1058,6 @@ sigset(0, (void (*)())0); sigset(0, (int (*)())0); #endif ], AC_DEFINE(USESIGSET)) -AC_CHECKING(signal implementation) -AC_TRY_RUN([ -#include -#include - -#ifndef SIGCLD -#define SIGCLD SIGCHLD -#endif -#ifdef USESIGSET -#define signal sigset -#endif - -int got; - -#ifdef SIGVOID -void -#endif -hand() -{ - got++; -} - -main() -{ - /* on hpux we use sigvec to get bsd signals */ -#ifdef __hpux - (void)signal(SIGCLD, hand); - kill(getpid(), SIGCLD); - kill(getpid(), SIGCLD); - if (got < 2) - exit(1); -#endif - exit(0); -} -],,AC_DEFINE(SYSVSIGS)) fi diff --git a/src/misc.c b/src/misc.c index 2228ff7..20def3b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -289,18 +289,7 @@ void closeallfiles(int except) { int f; -#ifdef SVR4 - struct rlimit rl; - - if ((getrlimit(RLIMIT_NOFILE, &rl) == 0) && rl.rlim_max != RLIM_INFINITY) - f = rl.rlim_max; - else -#endif /* SVR4 */ -#if defined(SYSV) && defined(NOFILE) && !defined(ISC) - f = NOFILE; -#else /* SYSV && !ISC */ f = getdtablesize(); -#endif /* SYSV && !ISC */ while (--f > 2) if (f != except) close(f); diff --git a/src/os.h b/src/os.h index 5bcf58f..92d8979 100644 --- a/src/os.h +++ b/src/os.h @@ -132,29 +132,7 @@ #endif #if defined(UTMPOK) || defined(BUGGYGETLOGIN) -# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux) -# include -# define UTMPFILE UTMPX_FILE -# define utmp utmpx -# define getutent getutxent -# define getutid getutxid -# define getutline getutxline -# define pututline pututxline -# define setutent setutxent -# define endutent endutxent -# define ut_time ut_xtime -# else /* SVR4 */ -# include -# endif /* SVR4 */ -# ifdef apollo - /* - * We don't have GETUTENT, so we dig into utmp ourselves. - * But we save the permanent filedescriptor and - * open utmp just when we need to. - * This code supports an unsorted utmp. jw. - */ -# define UTNOKEEP -# endif /* apollo */ +# include # ifndef UTMPFILE # ifdef UTMP_FILE diff --git a/src/screen.c b/src/screen.c index 3f03cba..32ee377 100644 --- a/src/screen.c +++ b/src/screen.c @@ -52,10 +52,6 @@ # include #endif -#if defined(SYSV) && !defined(ISC) -# include -#endif - #if defined(sequent) || defined(SVR4) # include #endif /* sequent || SVR4 */ @@ -327,27 +323,12 @@ main(int argc, char **argv) mode_t oumask; #else int oumask; -#endif -#if defined(SYSV) && !defined(ISC) - struct utsname utsnam; #endif struct NewWindow nwin; int detached = 0; /* start up detached */ char *sockp; char *sty = 0; -#if (defined(AUX) || defined(_AUX_SOURCE)) && defined(POSIX) - setcompat(COMPAT_POSIX|COMPAT_BSDPROT); /* turn on seteuid support */ -#endif -#if defined(sun) && defined(SVR4) - { - /* Solaris' login blocks SIGHUP! This is _very bad_ */ - sigset_t sset; - sigemptyset(&sset); - sigprocmask(SIG_SETMASK, &sset, 0); - } -#endif - /* * First, close all unused descriptors * (otherwise, we might have problems with the select() call) @@ -359,19 +340,10 @@ main(int argc, char **argv) snprintf(version, 59, "%d.%.2d.%.2d%s (%s%s) %s", REV, VERS, PATCHLEVEL, STATE, ORIGIN, GIT_REV, DATE); nversion = REV * 10000 + VERS * 100 + PATCHLEVEL; - debug2("-- screen debug started %s (%s)\n", *av, version); -#ifdef POSIX - debug("POSIX\n"); -#endif + debug2("-- screen debug started %s (%s)\n", *argv, version); #ifdef TERMIO debug("TERMIO\n"); #endif -#ifdef SYSV - debug("SYSV\n"); -#endif -#ifdef SYSVSIGS - debug("SYSVSIGS\n"); -#endif #ifdef NAMEDPIPE debug("NAMEDPIPE\n"); #endif @@ -1033,15 +1005,8 @@ main(int argc, char **argv) (void) umask(oumask); debug2("SockPath: %s SockMatch: %s\n", SockPath, SockMatch ? SockMatch : "NULL"); -#if defined(SYSV) && !defined(ISC) - if (uname(&utsnam) == -1) - Panic(errno, "uname"); - strncpy(HostName, utsnam.nodename, sizeof(utsnam.nodename) < MAXSTR ? sizeof(utsnam.nodename) : MAXSTR - 1); - HostName[sizeof(utsnam.nodename) < MAXSTR ? sizeof(utsnam.nodename) : MAXSTR - 1] = '\0'; -#else (void) gethostname(HostName, MAXSTR); HostName[MAXSTR - 1] = '\0'; -#endif if ((ap = strchr(HostName, '.')) != NULL) *ap = '\0'; @@ -1449,9 +1414,6 @@ SigChldHandler() { GotSigChld = 0; DoWait(); -#ifdef SYSVSIGS - signal(SIGCHLD, SigChld); -#endif } if (stat(SockPath, &st) == -1) { @@ -1517,9 +1479,6 @@ CoreDump (int sigsig) dump_msg = ""; #endif -#if defined(SYSVSIGS) && defined(SIGHASARG) - signal(sigsig, SIG_IGN); -#endif setgid(getgid()); setuid(getuid()); unlink("core"); diff --git a/src/screen.h b/src/screen.h index 3d13d39..df24c06 100644 --- a/src/screen.h +++ b/src/screen.h @@ -98,27 +98,7 @@ struct mode { -#ifdef POSIX struct termios tio; -# ifdef HPUX_LTCHARS_HACK - struct ltchars m_ltchars; -# endif /* HPUX_LTCHARS_HACK */ -#else /* POSIX */ -# ifdef TERMIO - struct termio tio; -# ifdef CYTERMIO - int m_mapkey; - int m_mapscreen; - int m_backspace; -# endif -# else /* TERMIO */ - struct sgttyb m_ttyb; - struct tchars m_tchars; - struct ltchars m_ltchars; - int m_ldisc; - int m_lmode; -# endif /* TERMIO */ -#endif /* POSIX */ #if defined(KANJI) && defined(TIOCKSET) struct jtchars m_jtchars; int m_knjmode; diff --git a/src/tty.sh b/src/tty.sh index 6755663..8de7b89 100644 --- a/src/tty.sh +++ b/src/tty.sh @@ -301,15 +301,6 @@ XIF{VSTATUS} m->tio.c_cc[VSTATUS] = Ctrl('T'); m->tio.c_cc[VTIME] = TTYVTIME; } -# ifdef HPUX_LTCHARS_HACK - m->m_ltchars.t_suspc = Ctrl('Z'); - m->m_ltchars.t_dsuspc = Ctrl('Y'); - m->m_ltchars.t_rprntc = Ctrl('R'); - m->m_ltchars.t_flushc = Ctrl('O'); - m->m_ltchars.t_werasc = Ctrl('W'); - m->m_ltchars.t_lnextc = Ctrl('V'); -# endif /* HPUX_LTCHARS_HACK */ - #if defined(TIOCKSET) m->m_jtchars.t_ascii = 'J'; m->m_jtchars.t_kanji = 'B'; @@ -324,9 +315,6 @@ struct mode *mp; { errno = 0; tcsetattr(fd, TCSADRAIN, &mp->tio); -# ifdef HPUX_LTCHARS_HACK - ioctl(fd, TIOCSLTC, (char *)&mp->m_ltchars); -# endif #if defined(TIOCKSET) ioctl(fd, TIOCKSETC, &mp->m_jtchars); ioctl(fd, TIOCKSET, &mp->m_knjmode); @@ -342,9 +330,6 @@ struct mode *mp; { errno = 0; tcgetattr(fd, &mp->tio); -# ifdef HPUX_LTCHARS_HACK - ioctl(fd, TIOCGLTC, (char *)&mp->m_ltchars); -# endif #if defined(TIOCKSET) ioctl(fd, TIOCKGETC, &mp->m_jtchars); ioctl(fd, TIOCKGET, &mp->m_knjmode); @@ -419,18 +404,9 @@ XIF{VSUSP} np->tio.c_cc[VSUSP] = VDISABLE; "autodetect" issues. */ XIF{VERASE} np->tio.c_cc[VERASE] = 0x7f; XIF{VKILL} np->tio.c_cc[VKILL] = VDISABLE; -# ifdef HPUX_LTCHARS_HACK - np->m_ltchars.t_suspc = VDISABLE; - np->m_ltchars.t_dsuspc = VDISABLE; - np->m_ltchars.t_rprntc = VDISABLE; - np->m_ltchars.t_flushc = VDISABLE; - np->m_ltchars.t_werasc = VDISABLE; - np->m_ltchars.t_lnextc = VDISABLE; -# else /* HPUX_LTCHARS_HACK */ XIF{VDSUSP} np->tio.c_cc[VDSUSP] = VDISABLE; XIF{VREPRINT} np->tio.c_cc[VREPRINT] = VDISABLE; XIF{VWERASE} np->tio.c_cc[VWERASE] = VDISABLE; -# endif /* HPUX_LTCHARS_HACK */ } /* operates on display */ @@ -1218,13 +1194,11 @@ struct mode *m; { debug2("c_cc[%d] = %#x\n", i, m->tio.c_cc[i]); } -# ifdef HPUX_LTCHARS_HACK debug1("suspc = %#02x\n", m->m_ltchars.t_suspc); debug1("dsuspc = %#02x\n", m->m_ltchars.t_dsuspc); debug1("rprntc = %#02x\n", m->m_ltchars.t_rprntc); debug1("flushc = %#02x\n", m->m_ltchars.t_flushc); debug1("werasc = %#02x\n", m->m_ltchars.t_werasc); debug1("lnextc = %#02x\n", m->m_ltchars.t_lnextc); -# endif /* HPUX_LTCHARS_HACK */ } #endif /* DEBUG */ -- cgit v1.2.1