mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-23 15:56:33 +00:00
testdisplay: don't read hotplug events from buffer before libudev
Otherwise we'll just block rather than trying to update the display. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
parent
b11d67a33b
commit
12de60a5e8
@ -750,19 +750,11 @@ static void usage(char *name)
|
|||||||
static gboolean hotplug_event(GIOChannel *source, GIOCondition condition,
|
static gboolean hotplug_event(GIOChannel *source, GIOCondition condition,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
gchar buf[256];
|
|
||||||
gsize count;
|
|
||||||
struct udev_device *dev;
|
struct udev_device *dev;
|
||||||
dev_t udev_devnum;
|
dev_t udev_devnum;
|
||||||
struct stat s;
|
struct stat s;
|
||||||
const char *hotplug;
|
const char *hotplug;
|
||||||
|
|
||||||
/* 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);
|
dev = udev_monitor_receive_device(uevent_monitor);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user