瀏覽代碼

Merge pull request #5617 from liggitt/preallocation

fileutil: avoid double preallocation
Anthony Romano 10 年之前
父節點
當前提交
bdc7035c10
共有 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)
 }