* path.cc (mount_info::add_item): The previous patch can't handle the case of

overwriting a mount entry.
This commit is contained in:
Christopher Faylor 2000-06-13 16:48:37 +00:00
parent fe871355b5
commit 024afd70d6
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Tue Jun 13 12:41:41 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* path.cc (mount_info::add_item): The previous patch can't handle
the case of overwriting a mount entry.
Tue Jun 13 00:17:04 2000 Christopher Faylor <cgf@cygnus.com>
* thread.h: Shorten "current_directory" variables to "cwd_*"

View File

@ -1645,13 +1645,15 @@ mount_info::add_item (const char *native, const char *posix, unsigned mountflags
break;
}
/* Can't add more than MAX_MOUNTS. */
if (i == nmounts && nmounts < MAX_MOUNTS)
i = nmounts++;
else
if (i == nmounts)
{
set_errno (EMFILE);
return -1;
if (nmounts < MAX_MOUNTS)
i = nmounts++;
else
{
set_errno (EMFILE);
return -1;
}
}
if (reg_p && add_reg_mount (nativetmp, posixtmp, mountflags))