Merge branch 'collectd-4.4'
[collectd.git] / src / exec.c
index 5f9d6ad..a80de1e 100644 (file)
@@ -692,9 +692,9 @@ static void *exec_notification_one (void *arg) /* {{{ */
     if (meta->type == NM_TYPE_STRING)
       fprintf (fh, "%s: %s\n", meta->name, meta->value_string);
     else if (meta->type == NM_TYPE_SIGNED_INT)
-      fprintf (fh, "%s: %lli\n", meta->name, meta->value_signed_int);
+      fprintf (fh, "%s: %"PRIi64"\n", meta->name, meta->value_signed_int);
     else if (meta->type == NM_TYPE_UNSIGNED_INT)
-      fprintf (fh, "%s: %llu\n", meta->name, meta->value_unsigned_int);
+      fprintf (fh, "%s: %"PRIu64"\n", meta->name, meta->value_unsigned_int);
     else if (meta->type == NM_TYPE_DOUBLE)
       fprintf (fh, "%s: %e\n", meta->name, meta->value_double);
     else if (meta->type == NM_TYPE_BOOLEAN)
@@ -788,6 +788,10 @@ static int exec_notification (const notification_t *n)
 
     pln->pl = pl;
     memcpy (&pln->n, n, sizeof (notification_t));
+
+    /* Set the `meta' member to NULL, otherwise `plugin_notification_meta_copy'
+     * will run into an endless loop. */
+    pln->n.meta = NULL;
     plugin_notification_meta_copy (&pln->n, n);
 
     pthread_attr_init (&attr);