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

Reply via email to