Diff of /perf_examples/task_cpu.c [4e98c0] .. [b187c7]  Maximize  Restore

  Switch to side-by-side view

--- a/perf_examples/task_cpu.c
+++ b/perf_examples/task_cpu.c
@@ -185,6 +185,8 @@
 	char buf;
 	pid_t pid;
 
+	go[0] = go[1] = -1;
+
 	if (pfm_initialize() != PFM_SUCCESS)
 		errx(1, "libpfm initialization failed");
 
@@ -292,7 +294,7 @@
 		}
 	}
 
-	if (!options.pid)
+	if (!options.pid && go[1] > -1)
 		close(go[1]);
 
 	if (options.print) {

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks