2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 04:45:15 +00:00

fuse: Don't return an error for EOF

This commit is contained in:
Alexander Neumann 2018-01-13 10:14:10 +01:00
parent d89f2e5226
commit f49f5c5903

View File

@ -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