From: Paul Sadauskas Date: Mon, 6 Jul 2009 20:15:29 +0000 (-0600) Subject: tokyotyrant plugin: Don't need to pass the db handle around, its global. X-Git-Tag: collectd-4.8.0~76^2~4 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=31a153c2bdf8e2ff270b58238cde64a15d2dfe6a;p=collectd.git tokyotyrant plugin: Don't need to pass the db handle around, its global. --- diff --git a/src/tokyotyrant.c b/src/tokyotyrant.c index 87001a05..160bf667 100644 --- a/src/tokyotyrant.c +++ b/src/tokyotyrant.c @@ -78,7 +78,7 @@ static int tt_config (const char *key, const char *value) return (0); } -static void printerr(TCRDB *rdb) +static void printerr() { int ecode = tcrdbecode(rdb); ERROR ("tokyotyrant plugin: error: %d, %s", @@ -108,8 +108,9 @@ static int tt_read (void) { gauge_t rnum, size; rnum = tcrdbrnum(rdb); - size = tcrdbsize(rdb); tt_submit (rnum, "records"); + + size = tcrdbsize(rdb); tt_submit (size, "file_size"); return (0); @@ -127,7 +128,7 @@ static int tt_init(void) if (!tcrdbopen(rdb, host, port)) { - printerr (rdb); + printerr (); tcrdbdel (rdb); return (1); } @@ -142,7 +143,7 @@ static int tt_shutdown(void) if (!tcrdbclose(rdb)) { - printerr (rdb); + printerr (); tcrdbdel (rdb); return (1); }