projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'github/pr/1088' into collectd-5.4
[collectd.git]
/
src
/
notify_desktop.c
diff --git
a/src/notify_desktop.c
b/src/notify_desktop.c
index
822b506
..
3f3c6df
100644
(file)
--- a/
src/notify_desktop.c
+++ b/
src/notify_desktop.c
@@
-24,12
+24,17
@@
*/
#include "collectd.h"
*/
#include "collectd.h"
+#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include <glib.h>
#include <libnotify/notify.h>
#include "plugin.h"
#include "configfile.h"
#include <glib.h>
#include <libnotify/notify.h>
+#ifndef NOTIFY_CHECK_VERSION
+# define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
#define log_info(...) INFO ("notify_desktop: " __VA_ARGS__)
#define log_warn(...) WARNING ("notify_desktop: " __VA_ARGS__)
#define log_err(...) ERROR ("notify_desktop: " __VA_ARGS__)
#define log_info(...) INFO ("notify_desktop: " __VA_ARGS__)
#define log_warn(...) WARNING ("notify_desktop: " __VA_ARGS__)
#define log_err(...) ERROR ("notify_desktop: " __VA_ARGS__)
@@
-71,7
+76,8
@@
static int c_notify_config (oconfig_item_t *ci)
return 0;
} /* c_notify_config */
return 0;
} /* c_notify_config */
-static int c_notify (const notification_t *n)
+static int c_notify (const notification_t *n,
+ user_data_t __attribute__((unused)) *user_data)
{
NotifyNotification *notification = NULL;
NotifyUrgency urgency = NOTIFY_URGENCY_LOW;
{
NotifyNotification *notification = NULL;
NotifyUrgency urgency = NOTIFY_URGENCY_LOW;
@@
-93,7
+99,12
@@
static int c_notify (const notification_t *n)
: (NOTIF_WARNING == n->severity) ? "WARNING"
: (NOTIF_OKAY == n->severity) ? "OKAY" : "UNKNOWN");
: (NOTIF_WARNING == n->severity) ? "WARNING"
: (NOTIF_OKAY == n->severity) ? "OKAY" : "UNKNOWN");
- notification = notify_notification_new (summary, n->message, NULL, NULL);
+ notification = notify_notification_new (summary, n->message, NULL
+#if NOTIFY_CHECK_VERSION (0, 7, 0)
+ );
+#else
+ , NULL);
+#endif
if (NULL == notification) {
log_err ("Failed to create a new notification.");
return -1;
if (NULL == notification) {
log_err ("Failed to create a new notification.");
return -1;
@@
-144,7
+155,8
@@
static int c_notify_init (void)
free (spec_version);
}
free (spec_version);
}
- plugin_register_notification ("notify_desktop", c_notify);
+ plugin_register_notification ("notify_desktop", c_notify,
+ /* user_data = */ NULL);
plugin_register_shutdown ("notify_desktop", c_notify_shutdown);
return 0;
} /* c_notify_init */
plugin_register_shutdown ("notify_desktop", c_notify_shutdown);
return 0;
} /* c_notify_init */