diff options
author | Xin LI <delphij@FreeBSD.org> | 2017-11-20 06:53:49 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2017-11-20 06:53:49 +0000 |
commit | ee3dcfe98fdc32918e3476f437b9603983d6d0be (patch) | |
tree | 62ec9b28431130ee7fc5037091ea243b4304955f /signal.c | |
parent | 6f90225e8378d85045013553763bd7483670441c (diff) |
Notes
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 36 |
1 files changed, 21 insertions, 15 deletions
@@ -78,22 +78,16 @@ stop(type) } #endif +#undef SIG_LESSWINDOW #ifdef SIGWINCH -/* - * "Window" change handler - */ - /* ARGSUSED*/ - public RETSIGTYPE -winch(type) - int type; -{ - LSIGNAL(SIGWINCH, winch); - sigs |= S_WINCH; - if (reading) - intread(); -} +#define SIG_LESSWINDOW SIGWINCH #else #ifdef SIGWIND +#define SIG_LESSWINDOW SIGWIND +#endif +#endif + +#ifdef SIG_LESSWINDOW /* * "Window" change handler */ @@ -102,13 +96,12 @@ winch(type) winch(type) int type; { - LSIGNAL(SIGWIND, winch); + LSIGNAL(SIG_LESSWINDOW, winch); sigs |= S_WINCH; if (reading) intread(); } #endif -#endif #if MSDOS_COMPILER==WIN32C /* @@ -133,6 +126,13 @@ wbreak_handler(dwCtrlType) } #endif + static RETSIGTYPE +terminate(type) + int type; +{ + quit(15); +} + /* * Set up the signal handlers. */ @@ -161,6 +161,9 @@ init_signals(on) #ifdef SIGQUIT (void) LSIGNAL(SIGQUIT, SIG_IGN); #endif +#ifdef SIGTERM + (void) LSIGNAL(SIGTERM, terminate); +#endif } else { /* @@ -182,6 +185,9 @@ init_signals(on) #ifdef SIGQUIT (void) LSIGNAL(SIGQUIT, SIG_DFL); #endif +#ifdef SIGTERM + (void) LSIGNAL(SIGTERM, SIG_DFL); +#endif } } |