diff options
author | jkoshy <jkoshy@FreeBSD.org> | 2008-12-23 12:08:06 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 2008-12-23 12:08:06 +0000 |
commit | dbc2a99f2f318f32dd12a01491dfc58c6ab15069 (patch) | |
tree | a662f83503cabda440be348a9c56ccb1f37bf6d5 /usr.sbin/pmcstat | |
parent | 868cc9f16c766ef19e2cd005f4ad5f2782dd25f5 (diff) | |
download | FreeBSD-src-dbc2a99f2f318f32dd12a01491dfc58c6ab15069.zip FreeBSD-src-dbc2a99f2f318f32dd12a01491dfc58c6ab15069.tar.gz |
Close the read side of the pipe to self when exiting.
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r-- | usr.sbin/pmcstat/pmcstat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index ea7264c..6496ddb 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -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), |