Minor changes: Small fixes and some more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2667 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
03fa4a4f9c
commit
57f5eb1c81
@ -82,6 +82,7 @@ DiskDeviceManager::MessageReceived(BMessage *message)
|
||||
void
|
||||
DiskDeviceManager::_NextDiskDeviceRequest(BMessage *message)
|
||||
{
|
||||
FUNCTION_START();
|
||||
status_t error = B_OK;
|
||||
int32 cookie = 0;
|
||||
BMessage reply(B_REG_RESULT);
|
||||
@ -90,12 +91,12 @@ DiskDeviceManager::_NextDiskDeviceRequest(BMessage *message)
|
||||
if (RDiskDevice *device = fDeviceList.DeviceWithID(cookie, false)) {
|
||||
// archive device
|
||||
BMessage deviceArchive;
|
||||
error = device->Archive(&deviceArchive);
|
||||
SET_ERROR(error, device->Archive(&deviceArchive));
|
||||
// add archived device and next cookie to reply message
|
||||
if (error == B_OK)
|
||||
error = reply.AddMessage("device", &deviceArchive);
|
||||
SET_ERROR(error, reply.AddMessage("device", &deviceArchive));
|
||||
if (error == B_OK)
|
||||
error = reply.AddInt32("cookie", device->ID() + 1);
|
||||
SET_ERROR(error, reply.AddInt32("cookie", device->ID() + 1));
|
||||
} else
|
||||
error = B_ENTRY_NOT_FOUND;
|
||||
} else
|
||||
|
@ -41,7 +41,7 @@ status_t
|
||||
RDiskDevice::SetTo(const char *path, int fd, const device_geometry *geometry,
|
||||
status_t mediaStatus)
|
||||
{
|
||||
FUNCTION_START();
|
||||
PRINT(("RDiskDevice::SetTo()\n"));
|
||||
Unset();
|
||||
status_t error = B_OK;
|
||||
fID = _NextID();
|
||||
@ -66,6 +66,7 @@ FUNCTION_START();
|
||||
break;
|
||||
default:
|
||||
error = fMediaStatus;
|
||||
break;
|
||||
}
|
||||
// scan the device for sessions, if we have a media
|
||||
if (fMediaStatus == B_OK) {
|
||||
|
@ -48,9 +48,9 @@ struct CompareIDPredicate : public UnaryPredicate<T> {
|
||||
{
|
||||
int32 id = object->ID();
|
||||
if (fID < id)
|
||||
return -1;
|
||||
if (fID > id)
|
||||
return 1;
|
||||
if (fID > id)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -131,18 +131,6 @@ RSession::RemovePartition(RPartition *partition)
|
||||
return success;
|
||||
}
|
||||
|
||||
// print_session_info
|
||||
static
|
||||
void
|
||||
print_session_info(const char *prefix, const session_info &info)
|
||||
{
|
||||
printf("%soffset: %lld\n", prefix, info.offset);
|
||||
printf("%ssize: %lld\n", prefix, info.size);
|
||||
printf("%sblock size: %ld\n", prefix, info.logical_block_size);
|
||||
printf("%sindex: %ld\n", prefix, info.index);
|
||||
printf("%sflags: %lx\n", prefix, info.flags);
|
||||
}
|
||||
|
||||
// Archive
|
||||
status_t
|
||||
RSession::Archive(BMessage *archive) const
|
||||
@ -177,6 +165,18 @@ RSession::Archive(BMessage *archive) const
|
||||
return error;
|
||||
}
|
||||
|
||||
// print_session_info
|
||||
static
|
||||
void
|
||||
print_session_info(const char *prefix, const session_info &info)
|
||||
{
|
||||
printf("%soffset: %lld\n", prefix, info.offset);
|
||||
printf("%ssize: %lld\n", prefix, info.size);
|
||||
printf("%sblock size: %ld\n", prefix, info.logical_block_size);
|
||||
printf("%sindex: %ld\n", prefix, info.index);
|
||||
printf("%sflags: %lx\n", prefix, info.flags);
|
||||
}
|
||||
|
||||
// Dump
|
||||
void
|
||||
RSession::Dump() const
|
||||
|
@ -22,9 +22,9 @@ struct CompareIDPredicate : public UnaryPredicate<RVolume> {
|
||||
{
|
||||
dev_t id = volume->ID();
|
||||
if (fID < id)
|
||||
return -1;
|
||||
if (fID > id)
|
||||
return 1;
|
||||
if (fID > id)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user