aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-07-30 02:56:46 -0700
committerGravatar Vijay Pai <vpai@google.com>2016-07-30 02:56:46 -0700
commit6e5c33c3e26ee1d43e2083034e05ffd0dc105934 (patch)
treef2d5a5120b6b34d92cc5de11e343d3865f295579
parent2507fef7379aa54cbced074f1b1e7ba3b53eae26 (diff)
Don't assert if we're not able to set affinity for some reason
-rw-r--r--test/cpp/qps/limit_cores.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/cpp/qps/limit_cores.cc b/test/cpp/qps/limit_cores.cc
index 59ed369067..b5c222542b 100644
--- a/test/cpp/qps/limit_cores.cc
+++ b/test/cpp/qps/limit_cores.cc
@@ -68,9 +68,9 @@ int LimitCores(const int* cores, int cores_size) {
cores_set++;
}
}
- GPR_ASSERT(sched_setaffinity(0, size, cpup) == 0);
+ bool affinity_set = (sched_setaffinity(0, size, cpup) == 0);
CPU_FREE(cpup);
- return cores_set;
+ return affinity_set ? cores_set : num_cores;
}
} // namespace testing