瀏覽代碼

fileutil: avoid double preallocation

Jordan Liggitt 9 年之前
父節點
當前提交
4f7622fb9a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/fileutil/preallocate.go

+ 1 - 1
pkg/fileutil/preallocate.go

@@ -23,7 +23,7 @@ import "os"
 // Otherwise, the error encountered will be returned.
 func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error {
 	if extendFile {
-		preallocExtend(f, sizeInBytes)
+		return preallocExtend(f, sizeInBytes)
 	}
 	return preallocFixed(f, sizeInBytes)
 }