From fb0d1c6980b3f9f912c2582e4a9f343a3108c03b Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 1 Sep 2020 14:52:39 +0000 Subject: [PATCH] diff: always properly kill pr(1) When diff is invoked with -l it will spawn the pr(1) program. In some circumpstances the pr(1) was not properly killed when diff program exits. Submitted by: Bret Ketchum MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26232 --- usr.bin/diff/diffreg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 1ee4be59fbc5..74c0df7dce30 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -412,10 +412,10 @@ diffreg(char *file1, char *file2, int flags, int capsicum) ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); check(f1, f2, flags); output(file1, f1, file2, f2, flags); - if (pr != NULL) - stop_pr(pr); closem: + if (pr != NULL) + stop_pr(pr); if (anychange) { status |= 1; if (rval == D_SAME) @@ -1704,4 +1704,4 @@ print_space(int nc, int n, int flags) { } } diff_output("%*s", col, ""); -} \ No newline at end of file +}