summaryrefslogtreecommitdiff
path: root/palm
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2004-07-01 16:31:03 +0000
committerBrian Feldman <green@FreeBSD.org>2004-07-01 16:31:03 +0000
commit9b5c71320b638969e96d6d5c59b8c1fe64f25274 (patch)
tree1d0b3fe04e11b78ebd44d24402fa9d7dea8e12b4 /palm
parentThe meanwhile-gaim distfile was rerolled to add some new buddy list saving (diff)
After many hours of fiddling with ugen and uvisor and coldsync and such,
I discovered that the only reason coldsync's ugen support doesn't work out of the box for a Treo 270 (HandSpring Visor-based phone) is that it uses a very low resolution sleep (one second) while waiting for USB devices to appear in "transient" mode. Due to this, it almost always misses the first packet in the HotSync, which comes from the Palm, and after five seconds the entire process would time out. Decrease the amount of time that is spent sleeping while waiting for USB devices to appear so that it works every time. (You probably do not want to try this without ugen(4) from yesterday which will NOT panic when the USB device goes away before programs with it open have closed their references.) Approved by: maintainer
Notes
Notes: svn path=/head/; revision=112676
Diffstat (limited to 'palm')
-rw-r--r--palm/coldsync/Makefile2
-rw-r--r--palm/coldsync/files/patch-libpconn_PConnection_usb.c40
2 files changed, 41 insertions, 1 deletions
diff --git a/palm/coldsync/Makefile b/palm/coldsync/Makefile
index 698d554add70..31c1a3f1f5db 100644
--- a/palm/coldsync/Makefile
+++ b/palm/coldsync/Makefile
@@ -7,7 +7,7 @@
PORTNAME= coldsync
PORTVERSION= 2.2.5
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= palm comms
MASTER_SITES= http://www.coldsync.org/download/
diff --git a/palm/coldsync/files/patch-libpconn_PConnection_usb.c b/palm/coldsync/files/patch-libpconn_PConnection_usb.c
new file mode 100644
index 000000000000..beffb7a0ddd8
--- /dev/null
+++ b/palm/coldsync/files/patch-libpconn_PConnection_usb.c
@@ -0,0 +1,40 @@
+--- libpconn/PConnection_usb.c.orig Thu Jul 1 01:51:27 2004
++++ libpconn/PConnection_usb.c Thu Jul 1 01:56:57 2004
+@@ -41,6 +41,10 @@
+ # include <libintl.h> /* For i18n */
+ #endif /* HAVE_LIBINTL_H */
+
++#if !HAVE_USLEEP
++int usleep(unsigned int usec); /* defined in PConnection_serial.c */
++#endif
++
+ #include "pconn/PConnection.h"
+ #include "palm.h"
+ #include "pconn/palm_errno.h"
+@@ -439,7 +443,7 @@
+ * you'll get an ENXIO until the device has been inserted
+ * on the USB bus.
+ */
+- for (i = 0; i < 30; i++) {
++ for (i = 0; i < 30 * (1000000 / 50000); i++) {
+ if ((usb_ep0 = open(device, O_RDWR | O_BINARY)) >= 0)
+ /* The O_BINARY flag is rather bogus, since
+ * the only relevant platform that uses it
+@@ -465,7 +469,7 @@
+ */
+ break;
+ }
+- sleep(1);
++ usleep(50000);
+ }
+
+ /*
+@@ -711,7 +715,7 @@
+ ((flags & PCONNFL_TRANSIENT) != 0))
+ {
+ /* Ignore this error and try again */
+- sleep(1);
++ usleep(10000);
+ continue;
+ }
+