From: guenther Date: Sun, 20 Jul 2014 09:31:25 +0000 (+0000) Subject: VSUSP and SIGTSTP are required by POSIX X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0680d6d658e248953fdce1c83db7ce0da700274c;p=openbsd VSUSP and SIGTSTP are required by POSIX --- diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index b6b3a3deb61..bc9bbfbd78b 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.63 2014/07/20 08:56:47 guenther Exp $ */ +/* $OpenBSD: commands.c,v 1.64 2014/07/20 09:31:25 guenther Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* @@ -1264,7 +1264,6 @@ togcrmod() int telnetsuspend() { -#ifdef SIGTSTP setcommandmode(); { long oldrows, oldcols, newrows, newcols, err; @@ -1284,9 +1283,6 @@ telnetsuspend() /* reget parameters in case they were changed */ TerminalSaveState(); setconnmode(0); -#else - printf("Suspend is not supported. Try the '!' command instead\r\n"); -#endif return 1; } diff --git a/usr.bin/telnet/externs.h b/usr.bin/telnet/externs.h index cc05172aa6f..227ec6cdfb8 100644 --- a/usr.bin/telnet/externs.h +++ b/usr.bin/telnet/externs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: externs.h,v 1.23 2014/07/20 08:56:47 guenther Exp $ */ +/* $OpenBSD: externs.h,v 1.24 2014/07/20 09:31:25 guenther Exp $ */ /* $KTH: externs.h,v 1.16 1997/11/29 02:28:35 joda Exp $ */ /* @@ -311,12 +311,8 @@ extern struct termios new_tc; # define termIntChar new_tc.c_cc[VINTR] # define termKillChar new_tc.c_cc[VKILL] # define termQuitChar new_tc.c_cc[VQUIT] +# define termSuspChar new_tc.c_cc[VSUSP] -# ifndef VSUSP -extern cc_t termSuspChar; -# else -# define termSuspChar new_tc.c_cc[VSUSP] -# endif # if defined(VFLUSHO) && !defined(VDISCARD) # define VDISCARD VFLUSHO # endif diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c index 371f0d7f9a2..2679ff04299 100644 --- a/usr.bin/telnet/sys_bsd.c +++ b/usr.bin/telnet/sys_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_bsd.c,v 1.21 2014/07/20 09:20:48 guenther Exp $ */ +/* $OpenBSD: sys_bsd.c,v 1.22 2014/07/20 09:31:25 guenther Exp $ */ /* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */ /* @@ -166,12 +166,10 @@ tcval(func) case SLC_XOFF: return(&termStopChar); case SLC_FORW1: return(&termForw1Char); case SLC_FORW2: return(&termForw2Char); + case SLC_SUSP: return(&termSuspChar); # ifdef VDISCARD case SLC_AO: return(&termFlushChar); # endif -# ifdef VSUSP - case SLC_SUSP: return(&termSuspChar); -# endif # ifdef VWERASE case SLC_EW: return(&termWerasChar); # endif @@ -242,9 +240,7 @@ TerminalDefaultChars() * local/no signal mapping */ -#ifdef SIGTSTP static void susp(); -#endif /* SIGTSTP */ #ifdef SIGINFO static void ayt(); #endif @@ -381,9 +377,7 @@ TerminalNewMode(f) } if (f != -1) { -#ifdef SIGTSTP (void) signal(SIGTSTP, susp); -#endif /* SIGTSTP */ #ifdef SIGINFO (void) signal(SIGINFO, ayt); #endif @@ -417,20 +411,16 @@ TerminalNewMode(f) # endif } } else { -#ifdef SIGTSTP sigset_t mask; -#endif /* SIGTSTP */ #ifdef SIGINFO void ayt_status(); (void) signal(SIGINFO, (void (*)(int))ayt_status); #endif -#ifdef SIGTSTP (void) signal(SIGTSTP, SIG_DFL); sigemptyset(&mask); sigaddset(&mask, SIGTSTP); sigprocmask(SIG_UNBLOCK, &mask, NULL); -#endif /* SIGTSTP */ tmp_tc = old_tc; } if (tcsetattr(tin, TCSADRAIN, &tmp_tc) < 0) @@ -611,7 +601,6 @@ intr2(sig) } } -#ifdef SIGTSTP /* ARGSUSED */ void susp(sig) @@ -622,7 +611,6 @@ susp(sig) if (localchars) sendsusp(); } -#endif #ifdef SIGWINCH /* ARGSUSED */ @@ -661,9 +649,7 @@ sys_telnet_init() #ifdef SIGWINCH (void) signal(SIGWINCH, sendwin); #endif -#ifdef SIGTSTP (void) signal(SIGTSTP, susp); -#endif #ifdef SIGINFO (void) signal(SIGINFO, ayt); #endif diff --git a/usr.bin/telnet/terminal.c b/usr.bin/telnet/terminal.c index 988f327d3f8..f26cd89e66f 100644 --- a/usr.bin/telnet/terminal.c +++ b/usr.bin/telnet/terminal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: terminal.c,v 1.10 2014/07/20 08:12:46 guenther Exp $ */ +/* $OpenBSD: terminal.c,v 1.11 2014/07/20 09:31:25 guenther Exp $ */ /* $NetBSD: terminal.c,v 1.5 1996/02/28 21:04:17 thorpej Exp $ */ /* @@ -47,9 +47,6 @@ cc_t termFlushChar; # ifndef VLNEXT cc_t termLiteralNextChar; # endif -# ifndef VSUSP -cc_t termSuspChar; -# endif # ifndef VWERASE cc_t termWerasChar; # endif