Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2017 06:36:21 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r322613 - head/bin/pkill
Message-ID:  <201708170636.v7H6aLRT068616@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Thu Aug 17 06:36:21 2017
New Revision: 322613
URL: https://svnweb.freebsd.org/changeset/base/322613

Log:
  The r322210 change to pgrep's PID delimiting behaviour causes pgrep's default
  output to not include a trailing new line, which is a potential POLA violation
  for existing consumers. Change pgrep to always emit a trailing new line on
  completion of its output, regardless of the delimeter in use (which technically
  is also a potential POLA violation for existing consumers that rely on the
  pre-r322210 buggy behaviour, but a line has to be drawn somewhere).
  
  PR:	221534
  Submitted by:	kdrakehp zoho com
  Reported by:	kdrakehp zoho com
  MFC after:	1 week
  X-MFC-with:	r322210

Modified:
  head/bin/pkill/pkill.c

Modified: head/bin/pkill/pkill.c
==============================================================================
--- head/bin/pkill/pkill.c	Thu Aug 17 05:09:22 2017	(r322612)
+++ head/bin/pkill/pkill.c	Thu Aug 17 06:36:21 2017	(r322613)
@@ -568,6 +568,8 @@ main(int argc, char **argv)
 			continue;
 		rv |= (*action)(kp);
 	}
+	if (rv && pgrep)
+		putchar('\n');
 	if (!did_action && !pgrep && longfmt)
 		fprintf(stderr,
 		    "No matching processes belonging to you were found\n");



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