From 3ab485ec080ceeb9d300498326d4e3082fc95153 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 4 Oct 2012 19:52:37 +0530 Subject: [PATCH] obexd: Update the file offset to the beginning after writing to the file When the transfer file is opened in O_RDWR mode, just after the contents are written to the file, the file offset has to be set to the beginning of the file. If not subsequent read fails. This patch fixes this. --- obexd/client/transfer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c index fbcafc821..cac388440 100644 --- a/obexd/client/transfer.c +++ b/obexd/client/transfer.c @@ -426,6 +426,7 @@ struct obc_transfer *obc_transfer_put(const char *type, const char *name, "Writing all contents to file failed"); goto fail; } + lseek(transfer->fd, 0, SEEK_SET); } else { if (!transfer_open(transfer, O_RDONLY, 0, err)) goto fail; -- 2.11.0