diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-11 10:56:41 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-02-11 11:22:53 +0000 |
commit | 28032382bce40392a98dd5ec71443a6f2bee7f27 (patch) | |
tree | 15ac5d2a5eefa3821f68052f34d37c9c97f60cf5 /tests/testdisplay.c | |
parent | 5534cb1c7566916a6bc39badf1eb4624399d542e (diff) |
testdisplay: Remove deprecated GIO functions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/testdisplay.c')
-rw-r--r-- | tests/testdisplay.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 5a422264..6f3f5ede 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -684,7 +684,11 @@ static gboolean hotplug_event(GIOChannel *source, GIOCondition condition, struct stat s; const char *hotplug; - g_io_channel_read(source, buf, 256, &count); + /* drain all pending events */ + do { + count = read(g_io_channel_unix_get_fd(source), + buf, sizeof(buf)); + } while (count > 0); dev = udev_monitor_receive_device(uevent_monitor); if (!dev) @@ -710,9 +714,7 @@ static gboolean input_event(GIOChannel *source, GIOCondition condition, gchar buf[256]; gsize count; - g_io_channel_read(source, buf, 255, &count); - buf[count] = '\0'; - + count = read(g_io_channel_unix_get_fd(source), buf, sizeof(buf)); if (buf[0] == 'q' && (count == 1 || buf[1] == '\n')) exit(0); |