#16 fix for sending file over USB to z520 in Linux

closed-accepted
None
5
2006-05-30
2006-04-28
Simon
No

Whenever I've tried to send files to my Sony-Ericsson
z520 over USB, it would hang at the 'Sending
"<file>".../' line, so I tracked down the issue and
wrote a patch for it.

It looks like one could consider this a workaround for
fixing the relevant driver itself ( I haven't bothered
to figure this out), but my patch just adds a retry
loop to the function that writes data to the cable
driver, which was failing because the write() call was
only writing part of what was requested. Should be
completely safe from infinite looping, but if I'm wrong
(say write
perpetually returns 0, if that's even possible), the
results are not catastrophic by any means, because
there's a usleep(1) call in the loop as part
of the workaround. So in short, applying this patch
can only be good, and may perhaps fix issues with more
than just my specific model of phone. It applies
cleanly to obexftp-0.18 and obex-ftp0.19.

Discussion

  • Simon

    Simon - 2006-04-28

    obexftp-cablewriteretry.patch

     
  • Simon

    Simon - 2006-05-17

    Logged In: YES
    user_id=1253354

    This updated patch is from gentoo's bugtracker - I submitted
    my changes there, and a developer improved on my patch
    (though they also removed my call to strerror(errno).

     
  • Simon

    Simon - 2006-05-17

    updated patch, from gentoo's bugtracker

     
  • Christian W. Zuckschwerdt

    • assigned_to: nobody --> zany
    • status: open --> closed-accepted
     
  • Hendrik Sattler

    Hendrik Sattler - 2007-01-08

    Logged In: YES
    user_id=356160
    Originator: NO

    To you and to the gentoo people: please read the manpage for the select() call and see that polling from the gentoo patch is not a good solution for this.
    Or make it MUCH simpler by remove the O_NONBLOCK flag from the file descriptor (that's why write comes back with EAGAIN).

     
  • Simon

    Simon - 2007-01-09

    Logged In: YES
    user_id=1253354
    Originator: YES

    Heh, sorry, I just don't know anything about these system calls yet. Feel free to submit a fix as opposed to my hack.

     

Log in to post a comment.