From f49f5c5903a37e77f248c447e565bc77579e3945 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 13 Jan 2018 10:14:10 +0100 Subject: [PATCH] fuse: Don't return an error for EOF --- internal/fuse/file.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/fuse/file.go b/internal/fuse/file.go index 642245cbc..233875993 100644 --- a/internal/fuse/file.go +++ b/internal/fuse/file.go @@ -4,7 +4,6 @@ package fuse import ( - "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/debug" @@ -111,7 +110,10 @@ func (f *file) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR if uint64(offset) > f.node.Size { debug.Log("Read(%v): offset is greater than file size: %v > %v", f.node.Name, req.Offset, f.node.Size) - return errors.New("offset greater than files size") + + // return no data + resp.Data = resp.Data[:0] + return nil } // handle special case: file is empty