summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2013-09-25 20:42:33 +0200
committerAlexander Larsson <alexl@redhat.com>2013-11-13 13:06:53 +0100
commit8ed7ab705715523467162283dd4357442655412b (patch)
tree820fc084ed9b89b5b31a713a76c2bbbff7ccc030
parentee2a74ce572209b746438b9faf558c009f037a78 (diff)
downloadgvfs-8ed7ab705715523467162283dd4357442655412b.tar.gz
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.
-rw-r--r--client/gvfsfusedaemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index ce15a0e7..e8cada17 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)
{