Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Sep 2020 14:52:39 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365041 - head/usr.bin/diff
Message-ID:  <202009011452.081EqdM8081058@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue Sep  1 14:52:39 2020
New Revision: 365041
URL: https://svnweb.freebsd.org/changeset/base/365041

Log:
  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

Modified:
  head/usr.bin/diff/diffreg.c

Modified: head/usr.bin/diff/diffreg.c
==============================================================================
--- head/usr.bin/diff/diffreg.c	Tue Sep  1 14:52:35 2020	(r365040)
+++ head/usr.bin/diff/diffreg.c	Tue Sep  1 14:52:39 2020	(r365041)
@@ -412,10 +412,10 @@ diffreg(char *file1, char *file2, int flags, int capsi
 	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
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009011452.081EqdM8081058>