unifying: Do not poll when we're waiting for device replug

If we happen to poll when the device is in the *process* of closing then the
open() fails in a weird way. If we're flashing it's probably a good idea to not
be too clever anyway...
This commit is contained in:
Richard Hughes 2017-06-22 09:35:33 +01:00
parent 7048044156
commit 3045d1ca3f

View File

@ -403,6 +403,13 @@ static gboolean
lu_context_poll_cb (gpointer user_data)
{
LuContext *ctx = LU_CONTEXT (user_data);
/* do not poll when we're waiting for device replug */
if (g_hash_table_size (ctx->hash_replug) > 0) {
g_warning ("NOT POLLING");
return TRUE;
}
for (guint i = 0; i < ctx->devices->len; i++) {
LuDevice *device = g_ptr_array_index (ctx->devices, i);
g_autoptr(GError) error = NULL;