From 486c5162422f0f89aa3b89a91c4cc849bede0fe4 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Tue, 15 Nov 2016 11:58:13 -0500 Subject: [PATCH] Stop trying to remove core dumps. unlink("core") doesn't work with OpenBSD, where core dumps have names like "ncg.core". Users who don't want core dumps can turn them off with "ulimit -c 0" in sh(1). Then the system doesn't write a core dump. That's better than writing core then unlinking it. --- util/ack/ack.1.X | 2 +- util/ack/run.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/util/ack/ack.1.X b/util/ack/ack.1.X index 689992ac7..1e35bca81 100644 --- a/util/ack/ack.1.X +++ b/util/ack/ack.1.X @@ -100,7 +100,7 @@ Note: \fIack\fP refuses to overwrite argument \fI.e\fP files. .IP \-t Preserve all intermediate files. If two \fB\-t\fP are used, -\fIack\fP also preserves core dumps and output of failed transformations. +\fIack\fP also preserves output of failed transformations. .IP \-w Suppress all warning messages. diff --git a/util/ack/run.c b/util/ack/run.c index ed88d66c7..32cb59fe5 100644 --- a/util/ack/run.c +++ b/util/ack/run.c @@ -87,8 +87,6 @@ static int run_exec(trf *phase, const char *prog) { } } while ( waitchild!=child) ; if ( status ) { - if ( status&0200 && (status&0177)!=SIGQUIT && - t_flag<=1 ) unlink("core") ; switch ( status&0177 ) { case 0 : break ;