Diff between 4002cf271e3939714296c535a1ed8d4f0d5ac005 and b552b55cf6688e84a02dc0af88bfae2ed8c10e79

Changed Files

File Additions Deletions Status
input/fakehid.c +4 -2 modified

Full Patch

diff --git a/input/fakehid.c b/input/fakehid.c
index eebca05..b809870 100644
--- a/input/fakehid.c
+++ b/input/fakehid.c
@@ -393,15 +393,17 @@ struct fake_input *fake_hid_connadd(struct fake_input *fake,
 
 	/* New device? Add it to the list of known devices,
 	 * and create the uinput necessary */
-	if (old == NULL) {
+	if (old == NULL || old->uinput < 0) {
 		if (fake_hid->setup_uinput(fake, fake_hid)) {
 			error("Error setting up uinput");
 			g_free(fake);
 			return NULL;
 		}
-		fake_hid->devices = g_list_append(fake_hid->devices, fake);
 	}
 
+	if (old == NULL)
+		fake_hid->devices = g_list_append(fake_hid->devices, fake);
+
 	fake->io = g_io_channel_ref(intr_io);
 	g_io_channel_set_close_on_unref(fake->io, TRUE);
 	g_io_add_watch(fake->io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,