From: Florian Forster Date: Wed, 25 Jan 2012 10:51:13 +0000 (+0100) Subject: write_mongodb plugin: Fix a format-string error. X-Git-Tag: collectd-5.1.0~42^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=fc5c43d7db4f05aae907eec5b0c5121bcf650709;p=collectd.git write_mongodb plugin: Fix a format-string error. Change-Id: Ia18cfa8ea7ef8536957c0807112620d2e0e2a976 --- diff --git a/src/write_mongodb.c b/src/write_mongodb.c index 510caf90..704ac071 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -122,17 +122,12 @@ static int wm_write (const data_set_t *ds, /* {{{ */ if(status != MONGO_OK) { ERROR ( "write_mongodb plugin: error inserting record: %d", node->conn->err); - if(node->conn->err == MONGO_BSON_INVALID) - { - ERROR (node->conn->errstr); - } else if ( record.err) - { - ERROR (record.errstr); - } - + if (node->conn->err == MONGO_BSON_INVALID) + ERROR ("write_mongodb plugin: %s", node->conn->errstr); + else if (record.err) + ERROR ("write_mongodb plugin: %s", record.errstr); } - pthread_mutex_unlock (&node->lock); return (0);