[gvfs] fuse: Fix seek offset calculation
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] fuse: Fix seek offset calculation
- Date: Wed, 2 Oct 2013 08:20:35 +0000 (UTC)
commit 64ccbde184653f2ce3ed3e5395eb336b379e5847
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Wed Sep 25 20:42:33 2013 +0200
fuse: Fix seek offset calculation
Since fh->pos is already incremented by n_bytes_skipped, check if
offset == fh->pos.
This error was hidden by the fact that the operation is retried when
-EIO is returned. When it was retried, the stream was already in the
correct position and so no seek operation was required.
client/gvfsfusedaemon.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index ce15a0e..e8cada1 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -1198,7 +1198,7 @@ read_stream (FileHandle *fh, gchar *output_buf, size_t output_buf_size, off_t of
if (n_bytes_skipped > 0)
fh->pos += n_bytes_skipped;
- if (n_bytes_skipped != offset - fh->pos)
+ if (offset != fh->pos)
{
if (error)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]