summaryrefslogtreecommitdiff
path: root/benchmarks/gem_wsim.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-05-17 18:06:24 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-05-17 18:06:24 +0100
commitf87eb22d43ee040d7f85c3737e344b70e05f3101 (patch)
treeca1fb0ea72d777a6a8df0d6147c3f824ca4c43c2 /benchmarks/gem_wsim.c
parent42e3cf129c5d7c706c510eec38ace943e70fa035 (diff)
gem_wsim: Fix client exit with more than one background workload
Need to close more pipe ends to support master with more than one background workloads. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'benchmarks/gem_wsim.c')
-rw-r--r--benchmarks/gem_wsim.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 13c029bf..c19cf1b3 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -1992,13 +1992,14 @@ int main(int argc, char **argv)
int pipe_fd = -1;
bool background = false;
- if (master_workload >= 0) {
- close(w[child]->pipe[0]);
- if (child != master_workload) {
+ for (i = 0; i < clients; i++) {
+ close(w[i]->pipe[0]);
+ if (master_workload >= 0 && child != master_workload &&
+ child == i) {
pipe_fd = w[child]->pipe[1];
background = true;
} else {
- close(w[child]->pipe[1]);
+ close(w[i]->pipe[1]);
}
}