summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-20 02:36:12 +0000
committerMiles Bader <miles@gnu.org>1996-07-20 02:36:12 +0000
commitc89f24a2b94a6752da0498a6608990252ee5685a (patch)
treebba8479a693d6a1cba3b8945d9d4bbe85f8b5913
parent38aab8c891f4e535c6b6f8bab95543a9517b7d76 (diff)
(diskfs_get_file_device): Don't deallocate the device port we've fetched.
-rw-r--r--libdiskfs/filedev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libdiskfs/filedev.c b/libdiskfs/filedev.c
index 31180aed..d7ee7030 100644
--- a/libdiskfs/filedev.c
+++ b/libdiskfs/filedev.c
@@ -111,8 +111,7 @@ diskfs_get_file_device (char *name,
*port = ports[0];
/* Deallocate things we don't care about or that we've made copies of. */
-
- for (i = 0; i < num_ports; i++)
+ for (i = (err || !port) ? 0 : 1; i < num_ports; i++)
if (MACH_PORT_VALID (ports[i]))
mach_port_deallocate (mach_task_self (), ports[i]);