projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1201af6
)
remove longjmp from signalhandler in getans
author
Philipp Takacs
<philipp@bureaucracy.de>
Sat, 21 Feb 2015 10:03:26 +0000
(11:03 +0100)
committer
Philipp Takacs
<philipp@bureaucracy.de>
Sun, 22 Feb 2015 22:10:00 +0000
(23:10 +0100)
To avoid undefined behavior use close in the signal handler.
sbr/getans.c
patch
|
blob
|
history
diff --git
a/sbr/getans.c
b/sbr/getans.c
index
7254d6b
..
f3cea27
100644
(file)
--- a/
sbr/getans.c
+++ b/
sbr/getans.c
@@
-10,6
+10,7
@@
#include <h/signals.h>
#include <setjmp.h>
#include <signal.h>
+#include <unistd.h>
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);
}