X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.c;h=20f3aa2b72d76fa6f0ef1f2901b600b881eadea5;hb=f3169b788b67f560f28b08eaddf1c45257cb1634;hp=1ec254417069a14cd3f9b8248476807edc91610a;hpb=68ab7da7a51018a00e6e03347182b988a30296a7;p=collectd.git diff --git a/src/plugin.c b/src/plugin.c index 1ec25441..20f3aa2b 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -367,6 +367,7 @@ int plugin_load (const char *type) else if (!S_ISREG (statbuf.st_mode)) { /* don't follow symlinks */ + WARNING ("stat %s: not a regular file", filename); continue; } @@ -901,8 +902,8 @@ static int plugin_notification_meta_add (notification_t *n, { case NM_TYPE_STRING: { - meta->value_string = strdup ((const char *) value); - if (meta->value_string == NULL) + meta->nm_value.nm_string = strdup ((const char *) value); + if (meta->nm_value.nm_string == NULL) { ERROR ("plugin_notification_meta_add: strdup failed."); sfree (meta); @@ -912,22 +913,22 @@ static int plugin_notification_meta_add (notification_t *n, } case NM_TYPE_SIGNED_INT: { - meta->value_signed_int = *((int64_t *) value); + meta->nm_value.nm_signed_int = *((int64_t *) value); break; } case NM_TYPE_UNSIGNED_INT: { - meta->value_unsigned_int = *((uint64_t *) value); + meta->nm_value.nm_unsigned_int = *((uint64_t *) value); break; } case NM_TYPE_DOUBLE: { - meta->value_double = *((double *) value); + meta->nm_value.nm_double = *((double *) value); break; } case NM_TYPE_BOOLEAN: { - meta->value_boolean = *((bool *) value); + meta->nm_value.nm_boolean = *((bool *) value); break; } default: @@ -1000,19 +1001,19 @@ int plugin_notification_meta_copy (notification_t *dst, { if (meta->type == NM_TYPE_STRING) plugin_notification_meta_add_string (dst, meta->name, - meta->value_string); + meta->nm_value.nm_string); else if (meta->type == NM_TYPE_SIGNED_INT) plugin_notification_meta_add_signed_int (dst, meta->name, - meta->value_signed_int); + meta->nm_value.nm_signed_int); else if (meta->type == NM_TYPE_UNSIGNED_INT) plugin_notification_meta_add_unsigned_int (dst, meta->name, - meta->value_unsigned_int); + meta->nm_value.nm_unsigned_int); else if (meta->type == NM_TYPE_DOUBLE) plugin_notification_meta_add_double (dst, meta->name, - meta->value_double); + meta->nm_value.nm_double); else if (meta->type == NM_TYPE_BOOLEAN) plugin_notification_meta_add_boolean (dst, meta->name, - meta->value_boolean); + meta->nm_value.nm_boolean); } return (0); @@ -1037,8 +1038,8 @@ int plugin_notification_meta_free (notification_t *n) if (this->type == NM_TYPE_STRING) { - free ((char *)this->value_string); - this->value_string = NULL; + free ((char *)this->nm_value.nm_string); + this->nm_value.nm_string = NULL; } sfree (this);