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:
@@ -59,6 +59,10 @@ extern list gPartitions;
|
|||||||
|
|
||||||
namespace boot {
|
namespace boot {
|
||||||
|
|
||||||
|
/** A convenience class to automatically close a
|
||||||
|
* file descriptor upon deconstruction.
|
||||||
|
*/
|
||||||
|
|
||||||
class NodeOpener {
|
class NodeOpener {
|
||||||
public:
|
public:
|
||||||
NodeOpener(Node *node, int mode)
|
NodeOpener(Node *node, int mode)
|
||||||
@@ -247,13 +251,19 @@ Partition::Scan()
|
|||||||
status_t
|
status_t
|
||||||
add_partitions_for(int fd)
|
add_partitions_for(int fd)
|
||||||
{
|
{
|
||||||
Partition partition(fd);
|
Partition *partition = new Partition(fd);
|
||||||
|
|
||||||
// set some magic/default values
|
// set some magic/default values
|
||||||
partition.block_size = 512;
|
partition->block_size = 512;
|
||||||
partition.size = partition.Size();
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user