Преглед на файлове

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)
 }