[gnome-settings-daemon] rfkill: set encoding as NULL



commit a5514ae097e5881df3ef26c63f4f4652b3f77811
Author: Ethan Hsieh <ethan hsieh canonical com>
Date:   Tue Oct 9 10:28:31 2018 +0800

    rfkill: set encoding as NULL
    
    The default encoding for GIOChannel is UTF-8, but rfkill event is binary
    data. If the value is invalid UTF-8, gsd-rfkill-manager will fail to
    receive rfkill event.

 plugins/rfkill/rfkill-glib.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/plugins/rfkill/rfkill-glib.c b/plugins/rfkill/rfkill-glib.c
index 259bafc0..9862105e 100644
--- a/plugins/rfkill/rfkill-glib.c
+++ b/plugins/rfkill/rfkill-glib.c
@@ -436,6 +436,7 @@ cc_rfkill_glib_open (CcRfkillGlib  *rfkill,
 
        /* Setup monitoring */
        rfkill->channel = g_io_channel_unix_new (fd);
+       g_io_channel_set_encoding (rfkill->channel, NULL, NULL);
        rfkill->watch_id = g_io_add_watch (rfkill->channel,
                                           G_IO_IN | G_IO_HUP | G_IO_ERR,
                                           (GIOFunc) event_cb,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]