linux-bluetooth.vger.kernel.org archive mirror
 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] client: remove unused field
Date: Thu, 19 Apr 2012 17:06:24 +0300	[thread overview]
Message-ID: <1334844388-7121-2-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1334844388-7121-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 bc4324d..a40f849 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-19 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 14:06 [PATCH obexd 1/6] client: Remove buffer based transfer Luiz Augusto von Dentz
2012-04-19 14:06 ` Luiz Augusto von Dentz [this message]
2012-04-19 14:06 ` [PATCH obexd 3/6] client: transfer api merges put and get Luiz Augusto von Dentz
2012-04-19 14:06 ` [PATCH obexd 4/6] client: transfers take gobex when starting Luiz Augusto von Dentz
2012-04-19 14:06 ` [PATCH obexd 5/6] client: open file during transfer creation Luiz Augusto von Dentz
2012-04-19 14:06 ` [PATCH obexd 6/6] client: Remove file in case of error Luiz Augusto von Dentz
  -- strict thread matches above, loose matches on Subject: below --
2012-01-20  9:49 [PATCH obexd 1/6] client: fix circular dependency of session and transfer Luiz Augusto von Dentz
2012-01-20  9:49 ` [PATCH obexd 2/6] client: remove unused field 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=1334844388-7121-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).