FIX: Don't use pre-allocation of disk space on the FAT32 under Linux (fixes #1739)

(cherry picked from commit c4ae646f00)
This commit is contained in:
Alexander Koblov 2024-06-30 14:31:54 +03:00
commit dfe6006ec8

View file

@ -1444,9 +1444,16 @@ function FileAllocate(Handle: System.THandle; Size: Int64): Boolean;
var
Ret: cint;
Sta: TStat;
StaFS: TStatFS;
begin
if (Size > 0) then
begin
repeat
Ret:= fpfStatFS(Handle, @StaFS);
until (Ret <> -1) or (fpgeterrno <> ESysEINTR);
// FAT32 does not support a fast allocation
if (StaFS.fstype = MSDOS_SUPER_MAGIC) then
Exit(False);
repeat
Ret:= fpFStat(Handle, Sta);
until (Ret <> -1) or (fpgeterrno <> ESysEINTR);