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
+}
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to