summaryrefslogtreecommitdiff
path: root/PLUGINS
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2022-11-26 18:18:03 +1100
committerPaul Mackerras <paulus@ozlabs.org>2022-11-26 18:18:03 +1100
commit184aaa447eea970cc7cb680263b104636e6e7a31 (patch)
treed005eea4e3b55d4a366eceb139f626738c072643 /PLUGINS
parentc42bade9f55544e30ec9d369c557742d36b7881e (diff)
downloadppp-184aaa447eea970cc7cb680263b104636e6e7a31.tar.gz
chat: Improve signal handling
This improves the way that signals are handled in chat. First, signal handlers should not be calling functions which are not async-signal-safe; doing so incurs the possibility of deadlock. Thus we can't call fatal() in signal handlers; instead we set 'fatalsig', which functions both as a flag and as an indication of which signal occurred, and check that at various points (basically after any operation which might block) using the new function checksigs(). Secondly, using sigaction rather than signal() means that we can control whether calls such as read() get restarted after a signal, and whether the signal disposition gets reset when the signal is delivered. That simplifies sigalrm(); we no longer need to re-register the handler, and we don't need the kludge of setting stdin to non-blocking mode in order to get the read() in get_char() to return. This also removes a #ifdef ultrix since ultrix is no longer supported. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'PLUGINS')
0 files changed, 0 insertions, 0 deletions