"authentication string.");
mongoc_client_destroy(node->client);
node->client = NULL;
- node->connected = 0;
+ node->connected = false;
return -1;
}
ERROR("write_mongodb plugin: Authenticating to [%s]:%d for database "
"\"%s\" as user \"%s\" failed.",
node->host, node->port, node->db, node->user);
- node->connected = 0;
+ node->connected = false;
sfree(uri);
return -1;
}
"authentication string.");
mongoc_client_destroy(node->client);
node->client = NULL;
- node->connected = 0;
+ node->connected = false;
return -1;
}
if (!node->client) {
ERROR("write_mongodb plugin: Connecting to [%s]:%d failed.", node->host,
node->port);
- node->connected = 0;
+ node->connected = false;
sfree(uri);
return -1;
}
ERROR("write_mongodb plugin: error creating/getting database");
mongoc_client_destroy(node->client);
node->client = NULL;
- node->connected = 0;
+ node->connected = false;
return -1;
}
- node->connected = 1;
+ node->connected = true;
return 0;
} /* }}} int wm_initialize */
mongoc_client_destroy(node->client);
node->database = NULL;
node->client = NULL;
- node->connected = 0;
+ node->connected = false;
pthread_mutex_unlock(&node->lock);
bson_destroy(bson_record);
return -1;
mongoc_client_destroy(node->client);
node->database = NULL;
node->client = NULL;
- node->connected = 0;
+ node->connected = false;
pthread_mutex_unlock(&node->lock);
bson_destroy(bson_record);
mongoc_collection_destroy(collection);
mongoc_client_destroy(node->client);
node->database = NULL;
node->client = NULL;
- node->connected = 0;
+ node->connected = false;
sfree(node->host);
sfree(node);
return ENOMEM;
}
node->port = MONGOC_DEFAULT_PORT;
- node->store_rates = 1;
+ node->store_rates = true;
pthread_mutex_init(&node->lock, /* attr = */ NULL);
status = cf_util_get_string_buffer(ci, node->name, sizeof(node->name));