From: Philipp Takacs Date: Sat, 21 Feb 2015 10:03:26 +0000 (+0100) Subject: remove longjmp from signalhandler in getans X-Git-Tag: mmh-0.2-RC1~54 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=8edab16f7a56c8e822f94609b69c4f95ee2eec3b;p=mmh remove longjmp from signalhandler in getans To avoid undefined behavior use close in the signal handler. --- diff --git a/sbr/getans.c b/sbr/getans.c index 7254d6b..f3cea27 100644 --- a/sbr/getans.c +++ b/sbr/getans.c @@ -10,6 +10,7 @@ #include #include #include +#include static char ansbuf[BUFSIZ]; static jmp_buf sigenv; @@ -72,5 +73,5 @@ intrser(int i) /* ** should this be siglongjmp? */ - longjmp(sigenv, 1); + close(STDIN_FILENO); }