Signal handling cleanup and improved safety

Fixes issue where you couldn't control-C out of a loop (https://github.com/ridiculousfish/fishfish/issues/13)
Also stops doing memory allocation in the signal handler (oops) https://github.com/ridiculousfish/fishfish/issues/27
This commit is contained in:
ridiculousfish
2012-06-04 14:20:01 -07:00
parent cc90f9cf80
commit 69446be1ee
9 changed files with 104 additions and 57 deletions

View File

@@ -493,19 +493,12 @@ static void reader_kill( size_t begin_idx, int length, int mode, int newv )
}
/* This is called from a signal handler! */
void reader_handle_int( int sig )
{
//PCA INSTANCED_PARSER what is this?
block_t *c = NULL;//current_block;
if( !is_interactive_read )
{
while( c )
{
c->type=FAKE;
c->skip=1;
c=c->outer;
}
parser_t::skip_all_blocks();
}
interrupted = 1;