diff options
author | green <green@FreeBSD.org> | 2004-07-02 00:31:03 +0800 |
---|---|---|
committer | green <green@FreeBSD.org> | 2004-07-02 00:31:03 +0800 |
commit | 52ff0e0cad7d7fff4033986baf9b6f9e563ad876 (patch) | |
tree | 8c1cf1d6678415b0b90bab4e7a7295470692f22c | |
parent | 12c6df2bdf2d4cd2656331b4bedcae56049cc6f3 (diff) | |
download | freebsd-ports-gnome-52ff0e0cad7d7fff4033986baf9b6f9e563ad876.tar.gz freebsd-ports-gnome-52ff0e0cad7d7fff4033986baf9b6f9e563ad876.tar.zst freebsd-ports-gnome-52ff0e0cad7d7fff4033986baf9b6f9e563ad876.zip |
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
-rw-r--r-- | palm/coldsync/Makefile | 2 | ||||
-rw-r--r-- | palm/coldsync/files/patch-libpconn_PConnection_usb.c | 40 |
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; + } + |