From fc5c43d7db4f05aae907eec5b0c5121bcf650709 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 25 Jan 2012 11:51:13 +0100 Subject: [PATCH] write_mongodb plugin: Fix a format-string error. Change-Id: Ia18cfa8ea7ef8536957c0807112620d2e0e2a976 --- src/write_mongodb.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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); -- 2.30.2