aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-01-26 13:16:47 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-01-26 13:16:47 -0800
commit6236718f158654c99b2c2eb52b1e991ce3195c28 (patch)
tree33f9b584be2f806e51e6c9b7d3d53fd93079be27 /src
parent927dae0da0e6f643bdcb0175dd5c2ea81c4ebce2 (diff)
parent7630256dede499c124e58da24a2e87f0ab454556 (diff)
Merge pull request #4897 from bogdandrutu/fix
Initialize census if not initialized yet and some features are available
Diffstat (limited to 'src')
-rw-r--r--src/core/surface/init.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index 19cea4c4f6..e3ab70dba7 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -117,8 +117,10 @@ void grpc_init(void) {
grpc_iomgr_init();
grpc_executor_init();
grpc_tracer_init("GRPC_TRACE");
- /* Only initialize census if noone else has. */
- if (census_enabled() == CENSUS_FEATURE_NONE) {
+ /* Only initialize census if no one else has and some features are
+ * available. */
+ if (census_enabled() == CENSUS_FEATURE_NONE &&
+ census_supported() != CENSUS_FEATURE_NONE) {
if (census_initialize(census_supported())) { /* enable all features. */
gpr_log(GPR_ERROR, "Could not initialize census.");
}