summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c7e43eb)
raw | patch | inline | side by side (parent: c7e43eb)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 20 May 2007 07:55:54 +0000 (09:55 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 20 May 2007 07:55:54 +0000 (09:55 +0200) |
A fix in the disk plugin has been removed again.
src/common.c | patch | blob | history | |
src/common.h | patch | blob | history | |
src/disk.c | patch | blob | history | |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history |
diff --git a/src/common.c b/src/common.c
index bcdf59aafdbd8a52a36579073f49ff2bf9b6c8f8..9a28cdbf7988d993a22be494f9c380e92413569f 100644 (file)
--- a/src/common.c
+++ b/src/common.c
}
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)
{
diff --git a/src/common.h b/src/common.h
index 6c097f6c0ad3e454e7b288508b730e8102108d01..7808ac93e696684c1ae794fc25963667973636d3 100644 (file)
--- a/src/common.h
+++ b/src/common.h
*/
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);
diff --git a/src/disk.c b/src/disk.c
index 5739f3697f6dce2bf29ec1ec995b05fa4aa672eb..38c161f58d6b0009fb61f9ddc3d01ec397a01dbe 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
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)
diff --git a/src/plugin.c b/src/plugin.c
index 64dbf7805c92cccef4113bdadac24e928b332b45..36cd80af61e7a9c9976465e9fdedd8928e4895c8 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
}
} /* 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, ...)
{
diff --git a/src/plugin.h b/src/plugin.h
index db556fce1af18950b75378274c7edebfcb57fcd4..83c21094eee789112d9eca42fceb7b4dca2dbedc 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
* `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__)