diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 09:05:35 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-18 09:05:35 -0800 |
| commit | 65141b240218df4c40196db63429b90b1cb698a9 (patch) | |
| tree | dfa9d8dde62c188f21b9c8dbb12b43252ad55f21 /bp.c | |
| parent | 4382fffbe06fa5832ba369e082438661719efa52 (diff) | |
Propagate signals better
Diffstat (limited to 'bp.c')
| -rw-r--r-- | bp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -192,7 +192,11 @@ static void cleanup(void) // // Signal handler to ensure cleanup happens. // -static void sig_handler(int sig) { (void)sig; cleanup(); } +static void sig_handler(int sig) +{ + cleanup(); + kill(0, sig); +} // // Present the user with a prompt to confirm replacements before they happen. @@ -285,10 +289,6 @@ static int inplace_modify_file(def_t *defs, file_t *f, pat_t *pattern) fprint_filename(tty_out, f->filename); } confirm_replacements(f, m, &confirm_file); - if (!in_use_tempfile) { // signal interrupted, so abort - fclose(inplace_file); - exit(1); - } print_match(inplace_file, &pr, m); } |
