Linux bluetooth development
 help / color / mirror / Atom feed
From: Srinivasa Ragavan <srinivasa.ragavan.venkateswaran@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Srinivasa Ragavan <srinivasa.ragavan.venkateswaran@intel.com>
Subject: [PATCH 1/4] client: Update the file offset to the beginning after writing to the file
Date: Sat,  6 Oct 2012 19:22:10 +0530	[thread overview]
Message-ID: <1349531535-706-2-git-send-email-srinivasa.ragavan.venkateswaran@intel.com> (raw)
In-Reply-To: <1349531535-706-1-git-send-email-srinivasa.ragavan.venkateswaran@intel.com>

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.
---
 client/transfer.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/client/transfer.c b/client/transfer.c
index fbcafc8..cac3884 100644
--- a/client/transfer.c
+++ b/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;
-- 
1.7.10.4


  reply	other threads:[~2012-10-06 13:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-06 13:52 [PATCH 1/3] client: Add implementation for UpdateInbox Srinivasa Ragavan
2012-10-06 13:52 ` Srinivasa Ragavan [this message]
2012-10-06 13:54   ` [PATCH 1/4] client: Update the file offset to the beginning after writing to the file Venkateswaran, Srinivasa Ragavan
2012-10-06 13:52 ` [PATCH 2/4] client: Add Message.SetProperty and Message.GetProperties implementation Srinivasa Ragavan
2012-10-06 13:54   ` Venkateswaran, Srinivasa Ragavan
2012-10-06 13:52 ` [PATCH 2/3] client-doc: Add documentation for UpdateInbox Srinivasa Ragavan
2012-10-06 13:52 ` [PATCH 3/3] test: Update map-client to include UpdateInbox Srinivasa Ragavan
2012-10-09  9:14 ` [PATCH 1/3] client: Add implementation for UpdateInbox Luiz Augusto von Dentz
2012-10-09 10:16   ` Venkateswaran, Srinivasa Ragavan
  -- strict thread matches above, loose matches on Subject: below --
2012-10-04 14:22 [PATCH 1/4] client: Update the file offset to the beginning after writing to the file Srinivasa Ragavan
2012-10-04 20:55 ` Luiz Augusto von Dentz
2012-10-04 13:30 Srinivasa Ragavan
2012-10-03 11:31 Srinivasa Ragavan

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=1349531535-706-2-git-send-email-srinivasa.ragavan.venkateswaran@intel.com \
    --to=srinivasa.ragavan.venkateswaran@intel.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