X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fxmms.c;h=01c7e0cfea9214cf536083614a2a9ac1b33129e8;hb=47faf00c18402cefd0e195d63ad48d5e7e6a4a92;hp=238a8ee3bf5e639dc0dd0718e49683b1448716af;hpb=c55316847bbd97410e65892b97f022e74bfe9b0f;p=collectd.git diff --git a/src/xmms.c b/src/xmms.c index 238a8ee3..01c7e0cf 100644 --- a/src/xmms.c +++ b/src/xmms.c @@ -39,8 +39,9 @@ static void cxmms_submit (const char *type, gauge_t value) vl.time = time (NULL); strcpy (vl.host, hostname_g); strcpy (vl.plugin, "xmms"); + sstrncpy (vl.type, type, sizeof (vl.type)); - plugin_dispatch_values (type, &vl); + plugin_dispatch_values (&vl); } /* void cxmms_submit */ int cxmms_read (void) @@ -55,7 +56,7 @@ int cxmms_read (void) xmms_remote_get_info (xmms_session, &rate, &freq, &nch); if ((freq == 0) || (nch == 0)) - return (0); + return (-1); cxmms_submit ("bitrate", rate); cxmms_submit ("frequency", freq);