Re: [PATCH obexd v1 02/11] client: remove unused field

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

 



Hi Mikel,

On Tue, Apr 10, 2012 at 4:38 PM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote:
> From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>
>
> The errorcode field is set but never used, so it can safely be removed.
> In addition there is no need for such a field, because errors can be
> propagated using the available callback.
> ---
>  client/transfer.c |   22 +++++-----------------
>  1 files changed, 5 insertions(+), 17 deletions(-)
>
> diff --git a/client/transfer.c b/client/transfer.c
> index 988ec10..a609aa9 100644
> --- a/client/transfer.c
> +++ b/client/transfer.c
> @@ -70,7 +70,6 @@ struct obc_transfer {
>        int filled;
>        gint64 size;
>        gint64 transferred;
> -       int err;
>  };
>
>  static GQuark obc_transfer_error_quark(void)
> @@ -310,10 +309,8 @@ static void get_buf_xfer_complete(GObex *obex, GError *err, gpointer user_data)
>
>        transfer->xfer = 0;
>
> -       if (err) {
> -               transfer->err = err->code;
> +       if (err)
>                goto done;
> -       }
>
>        if (transfer->filled > 0 &&
>                        transfer->buffer[transfer->filled - 1] == '\0')
> @@ -407,14 +404,9 @@ static void xfer_complete(GObex *obex, GError *err, gpointer user_data)
>
>        transfer->xfer = 0;
>
> -       if (err) {
> -               transfer->err = err->code;
> -               goto done;
> -       }
> -
> -       transfer->size = transfer->transferred;
> +       if (err == NULL)
> +               transfer->size = transfer->transferred;
>
> -done:
>        if (callback)
>                callback->func(transfer, transfer->size, err, callback->data);
>  }
> @@ -431,10 +423,8 @@ static gboolean get_xfer_progress(const void *buf, gsize len,
>                gint w;
>
>                w = write(transfer->fd, transfer->buffer, transfer->filled);
> -               if (w < 0) {
> -                       transfer->err = -errno;
> +               if (w < 0)
>                        return FALSE;
> -               }
>
>                transfer->filled -= w;
>        }
> @@ -478,10 +468,8 @@ static gssize put_xfer_progress(void *buf, gsize len, gpointer user_data)
>        gssize size;
>
>        size = read(transfer->fd, buf, len);
> -       if (size <= 0) {
> -               transfer->err = -errno;
> +       if (size <= 0)
>                return size;
> -       }
>
>        if (callback)
>                callback->func(transfer, transfer->transferred, NULL,
> --
> 1.7.7.6

Ack.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux