aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-04 14:20:01 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-04 14:20:01 -0700
commit69446be1ee063771f2e0b498a50f9b0787ea70c7 (patch)
treebe5ecf3a473052475218df605d350a204666c750 /reader.cpp
parentcc90f9cf803bc4aba928b2a80be451d9b717c5f0 (diff)
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
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/reader.cpp b/reader.cpp
index bc6b5123..ca3ac315 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -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;