diff options
author | 2013-01-22 11:19:01 +0100 | |
---|---|---|
committer | 2013-01-22 11:19:01 +0100 | |
commit | 55b3cf4627293ef91a061ba4c4bdc55810caacf5 (patch) | |
tree | 9de1820177eedc42fbd751f730ff94f6f3d8cbcd /reader.cpp | |
parent | eb1c00c56b59daf1799fdb0d6ee8e34d76bde419 (diff) |
move work out of interrupt handler (which is safer as well)
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -581,22 +581,10 @@ static void reader_kill(size_t begin_idx, size_t length, int mode, int newv) } -/* - Called from a signal handler, so make sure to check \c data exists. - This is in fact racey as there is no guarantee that \c *data's members are - written to memory before \c data is. But signal handling is currently racey - anyway, so this should be fixed together with the rest of the signal - handling infrastructure. -*/ -static bool get_interruptible() -{ - return data ? data->interruptible : false; -} - /* This is called from a signal handler! */ void reader_handle_int(int sig) { - if (!is_interactive_read || get_interruptible()) + if (!is_interactive_read) { parser_t::skip_all_blocks(); } @@ -671,6 +659,7 @@ int reader_reading_interrupted() if (res && data && data->interruptible) { reader_exit(1, 0); + parser_t::skip_all_blocks(); } return res; } |