[PATCH 8/8] obexd: Remove transferred file only if the GET operation failed

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

 



From: Christian Fetzer <christian.fetzer@xxxxxxxxxxxx>

Since 9606375649e12f1b9f302bbb5bb8f87957387ddd xfer_complete() sets the
transfer status rather than the size. Adapt obc_transfer_free to check
for the completed status to avoid deletion of completed transfers.
---
 obexd/client/transfer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index 541f405..427eab7 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -327,7 +327,8 @@ static void obc_transfer_free(struct obc_transfer *transfer)
 	}
 
 	if (transfer->op == G_OBEX_OP_GET &&
-					transfer->transferred != transfer->size)
+				transfer->status != TRANSFER_STATUS_COMPLETE &&
+				transfer->filename)
 		remove(transfer->filename);
 
 	if (transfer->fd > 0)
-- 
1.8.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