(_hurd_canonicalize_directory_name_internal): Don't deallocate DOTID & DOTDEVID until we're finished with them (we need to keep them at least until we've fetched the next level of id ports, so that mach will be able to use the same name if they're the same). Add inner_errlose: label, which deallocates DOTID & DOTDEVID and jumps to errlose, for those places where such cleanup is needed.

This commit is contained in:
Miles Bader 1996-06-26 17:44:44 +00:00
parent bba7bb78f3
commit aeb0816f97
1 changed files with 8 additions and 5 deletions

View File

@ -131,8 +131,6 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
/* Get this directory's identity and figure out if it's a mount point. */
if (err = __io_identity (parent, &dotid, &dotdevid, &dotino))
goto errlose;
__mach_port_deallocate (__mach_task_self (), dotid);
__mach_port_deallocate (__mach_task_self (), dotdevid);
mount_point = dotdevid != thisdevid;
/* Search for the last directory. */
@ -186,7 +184,7 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
err = __io_identity (try, &id, &devid, &fileno);
__mach_port_deallocate (__mach_task_self (), try);
if (err)
goto errlose;
goto inner_errlose;
__mach_port_deallocate (__mach_task_self (), id);
__mach_port_deallocate (__mach_task_self (), devid);
if (id == thisid)
@ -196,14 +194,19 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
}
if (err)
goto errlose;
{
inner_errlose: /* Goto ERRLOSE: after cleaning up. */
__mach_port_deallocate (__mach_task_self (), dotid);
__mach_port_deallocate (__mach_task_self (), dotdevid);
goto errlose;
}
else if (nentries == 0)
{
/* We got to the end of the directory without finding anything!
We are in a directory that has been unlinked, or something is
broken. */
err = ENOENT;
goto errlose;
goto inner_errlose;
}
else
found: