telnet: Define signal handlers on GNO with the proper signature (taking two arguments).

This commit is contained in:
Stephen Heumann 2015-06-01 17:55:24 -05:00
parent a1e8056a8b
commit 1c8d72b2d1
2 changed files with 26 additions and 11 deletions

View File

@ -220,6 +220,12 @@ extern int (*decrypt_input)(int);
#define SIG_FUNC_RET int #define SIG_FUNC_RET int
#endif #endif
#ifndef __GNO__
# define SIG_FUNC_PARMS(x) (x)
#else
# define SIG_FUNC_PARMS(x) (x, int sigcode __unused)
#endif
#ifdef SIGINFO #ifdef SIGINFO
extern SIG_FUNC_RET extern SIG_FUNC_RET
ayt_status(void); ayt_status(void);

View File

@ -112,16 +112,17 @@ static fd_set *ibitsp, *obitsp, *xbitsp;
int fdsn; int fdsn;
#ifdef SIGINT #ifdef SIGINT
static SIG_FUNC_RET intr(int); static SIG_FUNC_RET intr SIG_FUNC_PARMS(int);
#endif /* SIGINT */ #endif /* SIGINT */
#ifdef SIGQUIT #ifdef SIGQUIT
static SIG_FUNC_RET intr2(int); static SIG_FUNC_RET intr2 SIG_FUNC_PARMS(int);
#endif /* SIGQUIT */ #endif /* SIGQUIT */
#ifdef SIGTSTP #ifdef SIGTSTP
static SIG_FUNC_RET susp(int); static SIG_FUNC_RET susp SIG_FUNC_PARMS(int);
#endif /* SIGTSTP */ #endif /* SIGTSTP */
#ifdef SIGINFO #ifdef SIGINFO
static SIG_FUNC_RET ayt(int); static SIG_FUNC_RET ayt SIG_FUNC_PARMS(int);
static SIG_FUNC_RET ayt_status_wrapper SIG_FUNC_PARMS(int);
#endif #endif
void void
@ -643,7 +644,7 @@ TerminalNewMode(int f)
#endif #endif
} else { } else {
#ifdef SIGINFO #ifdef SIGINFO
(void) signal(SIGINFO, (void (*)(int))ayt_status); (void) signal(SIGINFO, ayt_status_wrapper);
#endif #endif
#ifdef SIGINT #ifdef SIGINT
(void) signal(SIGINT, SIG_DFL); (void) signal(SIGINT, SIG_DFL);
@ -746,7 +747,7 @@ NetNonblockingIO(int fd, int onoff)
/* ARGSUSED */ /* ARGSUSED */
SIG_FUNC_RET SIG_FUNC_RET
intr(int sig __unused) intr SIG_FUNC_PARMS(int sig __unused)
{ {
if (localchars) { if (localchars) {
intp(); intp();
@ -758,7 +759,7 @@ intr(int sig __unused)
/* ARGSUSED */ /* ARGSUSED */
SIG_FUNC_RET SIG_FUNC_RET
intr2(int sig __unused) intr2 SIG_FUNC_PARMS(int sig __unused)
{ {
if (localchars) { if (localchars) {
#ifdef KLUDGELINEMODE #ifdef KLUDGELINEMODE
@ -774,7 +775,7 @@ intr2(int sig __unused)
#ifdef SIGTSTP #ifdef SIGTSTP
/* ARGSUSED */ /* ARGSUSED */
SIG_FUNC_RET SIG_FUNC_RET
susp(int sig __unused) susp SIG_FUNC_PARMS(int sig __unused)
{ {
if ((rlogin != _POSIX_VDISABLE) && rlogin_susp()) if ((rlogin != _POSIX_VDISABLE) && rlogin_susp())
return; return;
@ -786,7 +787,7 @@ susp(int sig __unused)
#ifdef SIGWINCH #ifdef SIGWINCH
/* ARGSUSED */ /* ARGSUSED */
static SIG_FUNC_RET static SIG_FUNC_RET
sendwin(int sig __unused) sendwin SIG_FUNC_PARMS(int sig __unused)
{ {
if (connected) { if (connected) {
sendnaws(); sendnaws();
@ -797,7 +798,7 @@ sendwin(int sig __unused)
#ifdef SIGINFO #ifdef SIGINFO
/* ARGSUSED */ /* ARGSUSED */
SIG_FUNC_RET SIG_FUNC_RET
ayt(int sig __unused) ayt SIG_FUNC_PARMS(int sig __unused)
{ {
if (connected) if (connected)
sendayt(); sendayt();
@ -806,7 +807,15 @@ ayt(int sig __unused)
} }
#endif #endif
#ifdef SIGINFO
SIG_FUNC_RET
ayt_status_wrapper SIG_FUNC_PARMS(int sig __unused)
{
ayt_status();
}
#endif
void void
sys_telnet_init(void) sys_telnet_init(void)
{ {