[Haiku-commits] r31234 - haiku/trunk/src/system/kernel/disk_device_manager

bonefish at mail.berlios.de bonefish at mail.berlios.de
Thu Jun 25 17:35:21 CEST 2009


Author: bonefish
Date: 2009-06-25 17:35:16 +0200 (Thu, 25 Jun 2009)
New Revision: 31234
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31234&view=rev

Modified:
   haiku/trunk/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp
Log:
Patch by Bryce Groff: Implemented DeleteChild().


Modified: haiku/trunk/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp
===================================================================
--- haiku/trunk/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp	2009-06-25 07:58:51 UTC (rev 31233)
+++ haiku/trunk/src/system/kernel/disk_device_manager/KPartitioningSystem.cpp	2009-06-25 15:35:16 UTC (rev 31234)
@@ -451,8 +451,20 @@
 status_t
 KPartitioningSystem::DeleteChild(KPartition* child, disk_job_id job)
 {
-	// to be implemented
-	return B_ERROR;
+	if (!child || !child->Parent())
+		return B_BAD_VALUE;
+	if (!fModule->delete_child)
+		return B_NOT_SUPPORTED;
+
+	int fd = -1;
+	KPartition* parent = child->Parent();
+	status_t result = parent->Open(O_RDWR, &fd);
+	if (result != B_OK)
+		return result;
+
+	result = fModule->delete_child(fd, parent->ID(), child->ID(), job);
+	close(fd);
+	return result;
 }
 
 




More information about the Haiku-commits mailing list