FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

Re: [linux-minidisc] "netmdcli send" does not break on errors

<-- thread -->
<-- date -->
  • From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
  • To: Thomas Arp <manner.moe@gmx.de>
  • Date: Fri, 23 Sep 2011 21:32:57 +0200
  • Cc: Michael Karcher <Michael.Karcher@fu-berlin.de>, linux-minidisc@lists.fu-berlin.de
  • Subject: Re: [linux-minidisc] "netmdcli send" does not break on errors

On Sep 23, 2011, at 9:32 PM, Thomas Arp wrote:

> read is the return code from 
> libusb_bulk_transfer. So if return code is 0 which means no error, 
> data size of 0 will be written to the file and 0 will be added to the "done" variable.
> We have to use the variable "transferred" to check the data size. So the code must look like this:
> 
> read = libusb_bulk_transfer((libusb_device_handle*)dev, 0x81, data, (int)chunksize, &transferred, 10000);
>         if (read >= 0) {
>             done += (uint32_t)transferred;
>             fwrite(data, (uint32_t)transferred, 1, file
> );
> 
> This works, please change this. I do not make a patch because i am working on other changes and do not want to rebase yet.

Good point, thanks for finding this. I'm actually the one to blame for this change. It's
a result of the porting from libusb 0.0.1 to 1.0.0. I verified downloads to work, but
not uploads, since I don't have an MZ-RH1 lying around here.

You're definitely right.

I guess uploads didn't work before your fix then? (They shouldn't ;)).

Adrian




<-- thread -->
<-- date -->
  • Follow-Ups:
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Thomas Arp <manner.moe@gmx.de>
  • References:
    • [linux-minidisc] "netmdcli send" does not break on errors
      • From: Thomas Arp <manner.moe@gmx.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Thomas Arp <manner.moe@gmx.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Thomas Arp <manner.moe@gmx.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Michael Karcher <Michael.Karcher@fu-berlin.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Thomas Arp <manner.moe@gmx.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Michael Karcher <Michael.Karcher@fu-berlin.de>
    • Re: [linux-minidisc] "netmdcli send" does not break on errors
      • From: Thomas Arp <manner.moe@gmx.de>
  • linux-minidisc - September 2011 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the linux-minidisc mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal