mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: TDarwinDriverWatcher.tryAddDrive()
This commit is contained in:
parent
6233fbefd4
commit
49576ac7ee
1 changed files with 12 additions and 11 deletions
|
|
@ -77,6 +77,9 @@ uses
|
|||
{$ENDIF}
|
||||
;
|
||||
|
||||
const
|
||||
MAX_FS = 128;
|
||||
|
||||
{$IFDEF LINUX}
|
||||
type
|
||||
|
||||
|
|
@ -241,18 +244,18 @@ end;
|
|||
procedure TDarwinDriverWatcher.tryAddDrive( Sender: TObject );
|
||||
function driveReady: Boolean;
|
||||
var
|
||||
driveList: TDrivesList = nil;
|
||||
fsPtr: ^TFixedStatfs;
|
||||
fsList: array[0..MAX_FS] of TFixedStatfs;
|
||||
count: Integer;
|
||||
i: Integer;
|
||||
begin
|
||||
Result:= False;
|
||||
driveList:= TDriveWatcher.GetDrivesList;
|
||||
try
|
||||
for i:=0 to driveList.Count-1 do begin
|
||||
if _drivePath = driveList[i]^.Path then
|
||||
Exit( True );
|
||||
end;
|
||||
finally
|
||||
FreeAndNil( driveList );
|
||||
count := getfsstat(@fsList, SizeOf(fsList), MNT_WAIT);
|
||||
fsPtr := @fsList;
|
||||
for i:=0 to count-1 do begin
|
||||
if _drivePath = fsPtr^.mountpoint then
|
||||
Exit( True );
|
||||
inc( fsPtr );
|
||||
end;
|
||||
end;
|
||||
var
|
||||
|
|
@ -1296,8 +1299,6 @@ end;
|
|||
else
|
||||
Result := dtUnknown; // devfs, nullfs, procfs, etc.
|
||||
end;
|
||||
const
|
||||
MAX_FS = 128;
|
||||
var
|
||||
drive: PDrive;
|
||||
fstab: PFSTab;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue