[PATCH 1/3] Make use of transfer->err to store transfer errors

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

 



From: Luiz Augusto von Dentz <luiz.dentz-von@xxxxxxxxx>

---
 client/transfer.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/client/transfer.c b/client/transfer.c
index ea98b32..6eec513 100644
--- a/client/transfer.c
+++ b/client/transfer.c
@@ -360,7 +360,7 @@ static void put_xfer_progress(GwObexXfer *xfer, gpointer user_data)
 {
 	struct transfer_data *transfer = user_data;
 	struct transfer_callback *callback = transfer->callback;
-	gint written, err = 0;
+	gint written;
 
 	if (transfer->buffer_len == 0) {
 		transfer->buffer_len = DEFAULT_BUFFER_SIZE;
@@ -373,20 +373,20 @@ static void put_xfer_progress(GwObexXfer *xfer, gpointer user_data)
 		len = read(transfer->fd, transfer->buffer + transfer->filled,
 				transfer->buffer_len - transfer->filled);
 		if (len < 0) {
-			err = -errno;
+			transfer->err = -errno;
 			goto done;
 		}
 
 		transfer->filled += len;
 
 		if (transfer->filled == 0) {
-			gw_obex_xfer_close(xfer, &err);
+			gw_obex_xfer_close(xfer, &transfer->err);
 			goto done;
 		}
 
 		if (gw_obex_xfer_write(xfer, transfer->buffer,
 					transfer->filled,
-					&written, &err) == FALSE)
+					&written, &transfer->err) == FALSE)
 			goto done;
 
 		transfer->filled -= written;
@@ -397,7 +397,7 @@ static void put_xfer_progress(GwObexXfer *xfer, gpointer user_data)
 
 done:
 	if (callback)
-		callback->func(transfer, transfer->transferred, err,
+		callback->func(transfer, transfer->transferred, transfer->err,
 				callback->data);
 }
 
-- 
1.7.1

--
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