All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH obexd 2/6 v3] client: remove unused field
Date: Tue, 24 Apr 2012 12:20:03 +0300	[thread overview]
Message-ID: <1335259207-16111-2-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1335259207-16111-1-git-send-email-luiz.dentz@gmail.com>

From: Mikel Astiz <mikel.astiz@bmw-carit.de>

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 |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/client/transfer.c b/client/transfer.c
index f1cdbf0..1fa23c3 100644
--- a/client/transfer.c
+++ b/client/transfer.c
@@ -67,7 +67,6 @@ struct obc_transfer {
 	guint xfer;
 	gint64 size;
 	gint64 transferred;
-	int err;
 };
 
 static GQuark obc_transfer_error_quark(void)
@@ -288,10 +287,8 @@ static gboolean get_xfer_progress(const void *buf, gsize len,
 		gint w;
 
 		w = write(transfer->fd, buf, len);
-		if (w < 0) {
-			transfer->err = -errno;
+		if (w < 0)
 			return FALSE;
-		}
 
 		transfer->transferred += w;
 	}
@@ -310,10 +307,8 @@ static void xfer_complete(GObex *obex, GError *err, gpointer user_data)
 
 	transfer->xfer = 0;
 
-	if (err) {
-		transfer->err = err->code;
+	if (err)
 		goto done;
-	}
 
 	transfer->size = transfer->transferred;
 
@@ -390,10 +385,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


  reply	other threads:[~2012-04-24  9:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24  9:20 [PATCH obexd 1/6 v3] client: Remove buffer based transfer Luiz Augusto von Dentz
2012-04-24  9:20 ` Luiz Augusto von Dentz [this message]
2012-04-24  9:20 ` [PATCH obexd 3/6 v3] client: transfer api merges put and get Luiz Augusto von Dentz
2012-04-24  9:20 ` [PATCH obexd 4/6 v3] client: transfers take gobex when starting Luiz Augusto von Dentz
2012-04-24  9:20 ` [PATCH obexd 5/6 v3] client: open file during transfer creation Luiz Augusto von Dentz
2012-04-24  9:20 ` [PATCH obexd 6/6 v3] client: Remove file in case of error Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335259207-16111-2-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.