From fd691cfaf6d468ffce16a0db20a5960541799e6a Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 16 Jul 2022 22:45:08 +0200 Subject: [PATCH] Windows doesn't do signals much. --- util/ack/main.c | 10 ++-------- util/ack/run.c | 15 +++------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/util/ack/main.c b/util/ack/main.c index 9020e186c..269e6a571 100644 --- a/util/ack/main.c +++ b/util/ack/main.c @@ -21,7 +21,6 @@ static char rcs_id[] = "$Id$"; static char rcs_ack[] = RCS_ACK; #endif -static int sigs[] = { SIGINT, SIGHUP, SIGTERM, 0 }; static int arg_count; static char* srcvar(void); @@ -85,13 +84,8 @@ int main(int argc, char** argv) if (n_error && !k_flag) exit(n_error); - for (n_sig = sigs; *n_sig; n_sig++) - { - if (signal(*n_sig, noodstop) == SIG_IGN) - { - signal(*n_sig, SIG_IGN); - } - } + if (signal(SIGINT, noodstop) == SIG_IGN) + signal(SIGINT, SIG_IGN); scanlist(l_first(arguments), elem) { diff --git a/util/ack/run.c b/util/ack/run.c index dced2d5d2..d1c4fe730 100644 --- a/util/ack/run.c +++ b/util/ack/run.c @@ -179,18 +179,9 @@ static int run_exec(trf* phase, const char* prog) if (status) { - switch (status & 0177) - { - case 0: - break; - case SIGHUP: - case SIGINT: - case SIGQUIT: - case SIGTERM: - quit(-5); - default: - error("%s died with signal %d", prog, status & 0177); - } + if (status & 0177) + error("%s died with signal %d", prog, status & 0177); + /* The assumption is that processes voluntarely dying with a non-zero status already produced some sort of error message to the outside world.