A fix in the disk plugin has been removed again.
}
return (ret);
-}
+} /* int strsubstitute */
int escape_slashes (char *buf, int buf_len)
{
return (0);
}
+ if (buf_len <= 1)
+ return (0);
+
/* Move one to the left */
- memmove (buf, buf + 1, buf_len - 1);
+ if (buf[0] == '/')
+ memmove (buf, buf + 1, buf_len - 1);
for (i = 0; i < buf_len - 1; i++)
{
buf[i] = '\0';
return (0);
-}
+} /* int escape_slashes */
int timeval_sub_timespec (struct timeval *tv0, struct timeval *tv1, struct timespec *ret)
{
*/
int escape_slashes (char *buf, int buf_len);
+int strsubstitute (char *str, char c_from, char c_to);
+
/* FIXME: `timeval_sub_timespec' needs a description */
int timeval_sub_timespec (struct timeval *tv0, struct timeval *tv1, struct timespec *ret);
minor = atoll (fields[1]);
disk_name = fields[2];
- { /* Strip slashes from disk_name */
- int i;
- for (i = 0; disk_name[i] != '\0'; i++)
- if (disk_name[i] == '/')
- disk_name[i] = '_';
- }
-
for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
if (strcmp (disk_name, ds->name) == 0)
}
} /* void plugin_shutdown_all */
-int plugin_dispatch_values (const char *name, const value_list_t *vl)
+int plugin_dispatch_values (const char *name, value_list_t *vl)
{
int (*callback) (const data_set_t *, const value_list_t *);
data_set_t *ds;
}
#endif
+ escape_slashes (vl->host, sizeof (vl->host));
+ escape_slashes (vl->plugin, sizeof (vl->plugin));
+ escape_slashes (vl->plugin_instance, sizeof (vl->plugin_instance));
+ escape_slashes (vl->type_instance, sizeof (vl->type_instance));
+
le = llist_head (list_write);
while (le != NULL)
{
}
return (0);
-}
+} /* int plugin_dispatch_values */
void plugin_log (int level, const char *format, ...)
{
* `vl' Value list of the values that have been read by a `read'
* function.
*/
-int plugin_dispatch_values (const char *name, const value_list_t *vl);
+int plugin_dispatch_values (const char *name, value_list_t *vl);
void plugin_log (int level, const char *format, ...);
#define ERROR(...) plugin_log (LOG_ERR, __VA_ARGS__)