From 6604ef5be1929ce4d2e2e4c2ac447bb7c3adc6a0 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Wed, 13 Jan 2016 11:38:43 -0800 Subject: [PATCH] Writing contents of buffer to writer even if there was an error --- client/allocdir/alloc_dir.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/allocdir/alloc_dir.go b/client/allocdir/alloc_dir.go index 312866a6a..ea5a3d441 100644 --- a/client/allocdir/alloc_dir.go +++ b/client/allocdir/alloc_dir.go @@ -262,11 +262,8 @@ func (d *AllocDir) FSReadAt(allocID string, path string, offset int64, limit int return err } n, err := f.ReadAt(buf, offset) - if err != nil { - return err - } w.Write(buf[:n]) - return nil + return err } func fileCopy(src, dst string, perm os.FileMode) error {