Tracker: Check FSGetTrashDir() status, GetNextRef() is faster
Change-Id: I4f700a9170bc86aea73e4f9959ef05d1a4ddd6da Reviewed-on: https://review.haiku-os.org/c/haiku/+/10635 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
b283cb27dc
commit
0f098ae692
@@ -213,11 +213,13 @@ BTrashWatcher::CheckTrashDirs()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
BDirectory trashDir;
|
BDirectory trashDir;
|
||||||
FSGetTrashDir(&trashDir, volume.Device());
|
if (FSGetTrashDir(&trashDir, volume.Device()) == B_OK) {
|
||||||
trashDir.Rewind();
|
trashDir.Rewind();
|
||||||
BEntry entry;
|
// GetNextRef() is a bit faster than GetNextEntry()
|
||||||
if (trashDir.GetNextEntry(&entry) == B_OK)
|
entry_ref ref;
|
||||||
return true;
|
if (trashDir.GetNextRef(&ref) == B_OK)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user