Patch : enhance usb detection



The following patches is from Mandrake 9.0 package of gnome-pilot..

It is needed because on our system (which are using hotplug), there is a
big time slot between /proc/bus/usb/devices initial modification (ie
when hotsync is pressed) and when /proc/bus/usb/devices contains the
"Palm handheld" string which is used by gpilotd to detect hotsync has
been pressed..

Second part of the part is a big hack needed on Mdk 9.0 system because
we are using devfs and /dev/ttyUSB* doesn't exist until visor module is
loaded.. (should be replaced by checking if /dev/.devfsd exists and
therefore, discard the /dev/ttyUSB* test..)


-- 
Frederic Crozat <fcrozat mandrakesoft com>
MandrakeSoft
--- gnome-pilot-0.1.65/gpilotd/gpilotd.c.usb	2002-07-18 17:35:26.000000000 +0200
+++ gnome-pilot-0.1.65/gpilotd/gpilotd.c	2002-07-19 11:59:20.000000000 +0200
@@ -816,6 +816,7 @@
 visor_devices_in (GIOChannel *io_channel,
 		 GIOCondition condition,
 		 GPilotContext *context) {
+	static firstime = TRUE;
 	GPilotDevice *device;
 	GList *i;
 	gboolean visor_exists = FALSE;
@@ -826,11 +827,15 @@
 
 	g_assert (context != NULL);
 
-	sleep (2);	
-
 	if (context->paused) 
 		return FALSE;
 
+	if (!firstime )
+		sleep (10);	
+	else
+		firstime = FALSE;
+
+
 	/* Check /proc/bus/usb/devices for a visor */
 	f = fopen ("/proc/bus/usb/devices", "r");
 
--- gnome-pilot-0.1.65/capplet/util.c.usb	2002-04-22 20:46:39.000000000 +0200
+++ gnome-pilot-0.1.65/capplet/util.c	2002-07-18 17:35:26.000000000 +0200
@@ -643,6 +643,7 @@
 			return ;
 		}
 	} else if (device->type == PILOT_DEVICE_USB_VISOR) {
+/* don't check anything, it could be no device if we are using devfs
 		struct stat sb;
 			
 		if (stat (device->port, &sb) != 0) {
@@ -661,7 +662,7 @@
 			error_dialog (str);
 			g_free (str);
 			return ;
-		}
+		}*/
 	}
 
 }


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