summaryrefslogtreecommitdiff
path: root/plugins/rfkill/rfkill-glib.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/rfkill/rfkill-glib.c')
-rw-r--r--plugins/rfkill/rfkill-glib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/rfkill/rfkill-glib.c b/plugins/rfkill/rfkill-glib.c
index 6ef1143..37e43d2 100644
--- a/plugins/rfkill/rfkill-glib.c
+++ b/plugins/rfkill/rfkill-glib.c
@@ -4,6 +4,7 @@
*
* Copyright (C) 2012 Bastien Nocera <[email protected]>
* Copyright © 2017 Endless Mobile, Inc.
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -357,7 +358,11 @@ event_cb (GIOChannel *source,
print_event (&event);
+#if GLIB_CHECK_VERSION (2, 68, 0)
+ event_ptr = g_memdup2 (&event, sizeof(event));
+#else
event_ptr = g_memdup (&event, sizeof(event));
+#endif
events = g_list_prepend (events, event_ptr);
status = g_io_channel_read_chars (source,
@@ -440,7 +445,11 @@ cc_rfkill_glib_open (CcRfkillGlib *rfkill)
type_to_string (event.type),
event.idx, event.soft, event.hard);
+#if GLIB_CHECK_VERSION (2, 68, 0)
+ event_ptr = g_memdup2 (&event, sizeof(event));
+#else
event_ptr = g_memdup (&event, sizeof(event));
+#endif
events = g_list_prepend (events, event_ptr);
}