Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2008 12:08:06 +0000 (UTC)
From:      Joseph Koshy <jkoshy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186425 - head/usr.sbin/pmcstat
Message-ID:  <200812231208.mBNC86QR099361@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkoshy
Date: Tue Dec 23 12:08:06 2008
New Revision: 186425
URL: http://svn.freebsd.org/changeset/base/186425

Log:
  Close the read side of the pipe to self when exiting.

Modified:
  head/usr.sbin/pmcstat/pmcstat.c

Modified: head/usr.sbin/pmcstat/pmcstat.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcstat.c	Tue Dec 23 09:11:05 2008	(r186424)
+++ head/usr.sbin/pmcstat/pmcstat.c	Tue Dec 23 12:08:06 2008	(r186425)
@@ -1264,6 +1264,9 @@ main(int argc, char **argv)
 				/* Kill the child process if we started it */
 				if (args.pa_flags & FLAG_HAS_COMMANDLINE)
 					pmcstat_kill_process(&args);
+				/* Close the pipe to self, if present. */
+				if (args.pa_flags & FLAG_HAS_PIPE)
+					(void) close(pipefd[READPIPEFD]);
 				runstate = PMCSTAT_FINISHED;
 			} else if (kev.ident == SIGWINCH) {
 				if (ioctl(fileno(args.pa_printfile),



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