The main partition can now contain file systems as well (it's no longer

created on the stack, and added to the gPartitions list in that case).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4693 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-09-15 21:55:45 +00:00
parent b8baf385d1
commit 3ad474d024

View File

@ -59,6 +59,10 @@ extern list gPartitions;
namespace boot {
/** A convenience class to automatically close a
* file descriptor upon deconstruction.
*/
class NodeOpener {
public:
NodeOpener(Node *node, int mode)
@ -247,13 +251,19 @@ Partition::Scan()
status_t
add_partitions_for(int fd)
{
Partition partition(fd);
Partition *partition = new Partition(fd);
// set some magic/default values
partition.block_size = 512;
partition.size = partition.Size();
partition->block_size = 512;
partition->size = partition->Size();
return partition.Scan();
if (partition->Scan() == B_OK && partition->IsFileSystem()) {
list_add_item(&gPartitions, partition);
return B_OK;
}
delete partition;
return B_OK;
}