فهرست منبع

Merge pull request #5617 from liggitt/preallocation

fileutil: avoid double preallocation
Anthony Romano 9 سال پیش
والد
کامیت
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.
 // Otherwise, the error encountered will be returned.
 func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error {
 func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error {
 	if extendFile {
 	if extendFile {
-		preallocExtend(f, sizeInBytes)
+		return preallocExtend(f, sizeInBytes)
 	}
 	}
 	return preallocFixed(f, sizeInBytes)
 	return preallocFixed(f, sizeInBytes)
 }
 }