Patch by Bryce Groff:

* SetBusy(): Use AddFlags() instead of SetFlags() so that the other flags
  aren't cleared.
* AddChild(): Publish the newly added child partition. Otherwise no-one can do
  anything with it without rebooting first. Other children may need to be
  republished under a new name, if their index changes, which doesn't happen
  yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31444 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-07 13:10:52 +00:00
parent 16d5c24e53
commit 34bc7f03ed
@@ -243,7 +243,7 @@ void
KPartition::SetBusy(bool busy) KPartition::SetBusy(bool busy)
{ {
if (busy) if (busy)
SetFlags(B_PARTITION_BUSY); AddFlags(B_PARTITION_BUSY);
else else
ClearFlags(B_PARTITION_BUSY); ClearFlags(B_PARTITION_BUSY);
} }
@@ -771,6 +771,10 @@ KPartition::AddChild(KPartition *partition, int32 index)
fPartitionData.child_count++; fPartitionData.child_count++;
partition->SetParent(this); partition->SetParent(this);
partition->SetDevice(Device()); partition->SetDevice(Device());
// publish to devfs
error = PublishDevice();
if (error != B_OK)
return error;
// notify listeners // notify listeners
FireChildAdded(partition, index); FireChildAdded(partition, index);
return B_OK; return B_OK;
@@ -896,7 +900,7 @@ KPartition::VisitEachDescendant(KPartitionVisitor *visitor)
} }
if (visitor->VisitPost(this)) if (visitor->VisitPost(this))
return this; return this;
return NULL; return NULL;
} }