Fixed old test.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4145 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <KDiskDevice.h>
|
#include <KDiskDevice.h>
|
||||||
#include <KDiskDeviceManager.h>
|
#include <KDiskDeviceManager.h>
|
||||||
|
#include <KDiskDeviceUtils.h>
|
||||||
|
|
||||||
const char *kTestFileDevice = "/boot/home/tmp/test-file-device";
|
const char *kTestFileDevice = "/boot/home/tmp/test-file-device";
|
||||||
|
|
||||||
@@ -23,13 +24,21 @@ main()
|
|||||||
partition_id id = manager->CreateFileDevice(kTestFileDevice);
|
partition_id id = manager->CreateFileDevice(kTestFileDevice);
|
||||||
if (id < B_OK)
|
if (id < B_OK)
|
||||||
printf("creating the file device failed: %s\n", strerror(id));
|
printf("creating the file device failed: %s\n", strerror(id));
|
||||||
if (manager->Lock()) {
|
// wait for scanning jobs to finish
|
||||||
for (int32 cookie = 0;
|
for (;;) {
|
||||||
KDiskDevice *device = manager->NextDevice(&cookie); ) {
|
if (ManagerLocker locker = manager) {
|
||||||
|
if (manager->CountJobs() == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// print devices
|
||||||
|
for (int32 cookie = 0;
|
||||||
|
KDiskDevice *device = manager->RegisterNextDevice(&cookie); ) {
|
||||||
|
PartitionRegistrar _(device, true);
|
||||||
|
if (DeviceReadLocker locker = device) {
|
||||||
device->Dump();
|
device->Dump();
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
manager->Unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// error = manager->DeleteFileDevice(kTestFileDevice);
|
// error = manager->DeleteFileDevice(kTestFileDevice);
|
||||||
|
|||||||
Reference in New Issue
Block a user