summaryrefslogtreecommitdiff
path: root/usr.sbin/pmcstudy
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2015-01-27 18:56:22 +0000
committerRandall Stewart <rrs@FreeBSD.org>2015-01-27 18:56:22 +0000
commitcb8266e79741e2e73ddb968761e192f8c9e02508 (patch)
tree5d8c137168764e5aaf7a0a6d502e02acd021171f /usr.sbin/pmcstudy
parentda8e209f333c58c144c6593d50d71de0b025364a (diff)
downloadsrc-test2-cb8266e79741e2e73ddb968761e192f8c9e02508.tar.gz
src-test2-cb8266e79741e2e73ddb968761e192f8c9e02508.zip
Notes
Diffstat (limited to 'usr.sbin/pmcstudy')
-rw-r--r--usr.sbin/pmcstudy/pmcstudy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/pmcstudy/pmcstudy.c b/usr.sbin/pmcstudy/pmcstudy.c
index a99d59a8cb33..a7ec3719a0b4 100644
--- a/usr.sbin/pmcstudy/pmcstudy.c
+++ b/usr.sbin/pmcstudy/pmcstudy.c
@@ -1796,6 +1796,10 @@ process_file(char *filename)
if (filename == NULL) {
io = my_popen(command, "r", &pid_of_command);
+ if (io == NULL) {
+ printf("Can't popen the command %s\n", command);
+ return;
+ }
} else {
io = fopen(filename, "r");
if (io == NULL) {
@@ -1808,8 +1812,10 @@ process_file(char *filename)
if (cnts == NULL) {
/* Nothing we can do */
printf("Nothing to do -- no counters built\n");
- if (io) {
- fclose(io);
+ if (filename) {
+ fclose(io);
+ } else {
+ my_pclose(io, pid_of_command);
}
return;
}