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

Re: [coldsync-hackers] Re: Problem respawning coldsync daemon



On Tue, 2002-03-05 at 02:25, Alessandro Zummo wrote:
>  On 04-Mar-02 at 05:38:27,
>   Andrew Bainbridge-Smith <Andrew.Bainbridge-Smith@csiro.au> wrote:
>
> > Excellent.  Though I think a few changes to coldsync may still be in
> > order so that the script doesn't have to have the USER hardwired, which
> > is no good for site with multiple palms (this doesn't apply to me) ---
> > yes I can see that it call with -md, but that doesn't seem quite right. 
> > I was thinking that the standalone and daemon modes could be rolled
> > together and maybe a proper(?) daemon mode (for those without hotplug!)
> > could be created.  A thought at this point, obviously needs a bit more
> > thinking about the implications etc.
> 
> attaching coldsync to the hotplug event could be a solution, but it
> would be better if we can find a way to work without it.

Attaching to the hotplug event appeals to me, but there are alot of
issues to deal with; (a) what about backup/restore and initialize modes?
(b) need to roll the user determination stuff that is part of daemon
mode into standalone mode (maybe), (c) somewhere along the line some
additional security stuff may become relevant (extremely difficult but
possibly easier with hotplug --- again no clarity or justification for
this statement:-).  In anycase I don't think any of this is directly
relevant to the problems observed.

> I'm waiting for your patch ;)

Here is the patch.  Produced using diff against coldsync-2.3.0-20011210
(diff -r newversion oldversion).  Hope this is the way you like it.  Let
me know ASAP if you want it in a different form (give example) or
against version 2.2.5

	Andrew

---cut here---
diff -r ./libpconn/PConnection_serial.c
/home/abs/tmp/coldsync-2.3.0/libpconn/PConnection_serial.c
411d410
<       struct timeval timeout; /* How long to wait for incoming data */
422,424d420
<       /* Need to check the file descriptor because this function
<        * is called both for normal and abnormal termination.
<        */
426,434c422,424
<         {
<           /* Need to ensure the device hasn't gone away as
HotPluggable
<            * USB devices have a habit of doing.
<            */
<           timeout.tv_sec = NETSYNC_WAIT_TIMEOUT;
<           timeout.tv_usec = 0L;
<           err = (*p->io_select)(p, forReading, &timeout);
<           if (err > 0)
<             {
---
>               /* Need to check the file descriptor because this
function
>                * is called both for normal and abnormal termination.
>                */
436,439c426,427
<               if (err < 0)
<             {
---
>               /* Need to check the file descriptor because this
function
>                * is called both for normal and abnormal termination.
>                */
436,439c426,427
<               if (err < 0)
<                 perror("tcdrain");
<             }
<         }
---
>       if (err < 0)
>               perror("tcdrain");

diff -r ./libpconn/dlp_cmd.c
/home/abs/tmp/coldsync-2.3.0/libpconn/dlp_cmd.c
2883,2889d2882
<       /*** XXX Arbitruary sleep of 1 second, this is to allow
<        *** hotpluggable USB devices to disconnect.  There should
<        *** be a better way, like polling pconn->fd to see if read or
<        *** writeable.  But what ever method used it is necessary to
<        *** bear in mind that the device may not be hotpluggable.
<        ***/
<       sleep (1);




-- 
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.