Date:2011-06-21 02:14:14 (8 years 3 months ago)
Author:Werner Almesberger
Commit:10b6d88af91815681e16f8e44a803a6b35fffbdf
Message:libatrf: simplify use of atrf_interrupt_wait now this it is mandatory

- lib/atrf.c (atrf_interrupt_wait): interrupt_wait is no longer
optional
- atrf-proxy/atrf-proxy.c (cmd_more): we no longer need to handle
atrf_interrupt_wait being unsupported
- lib/atusb-common.c (atusb_interrupt_wait): clarify what we don't
want to return -1 on error
Files: tools/atrf-proxy/atrf-proxy.c (1 diff)
tools/lib/atrf.c (1 diff)
tools/lib/atusb-common.c (1 diff)

Change Details

tools/atrf-proxy/atrf-proxy.c
176176        res = atrf_interrupt_wait(dsc, n);
177177        if (atrf_error(dsc))
178178            return netio_printf(netio, "-I/O error\n");
179        if (res < 0)
180            return netio_printf(netio, "-not supported\n");
181179        return netio_printf(netio, "+0x%02x\n", res);
182180    }
183181    if (!strcasecmp(cmd, "getram")) {
tools/lib/atrf.c
320320
321321int atrf_interrupt_wait(struct atrf_dsc *dsc, int timeout_ms)
322322{
323    return dsc->driver->interrupt_wait ?
324        dsc->driver->interrupt_wait(dsc->handle, timeout_ms) : -1;
323    return dsc->driver->interrupt_wait(dsc->handle, timeout_ms);
325324}
tools/lib/atusb-common.c
221221        if (res < 0) {
222222            fprintf(stderr, "usb_bulk_read: %d\n", res);
223223            dsc->error = 1;
224            return 0;
225                /* < 0 is already taken by atrf_interrupt_wait */
224            return 0; /* handle this via atrf_error */
226225        }
227226        timeout_ms = 1;
228227        for (i = 0; i != res; i++)

Archive Download the corresponding diff file



interactive