From 024afd70d6454efb12c94eaa092ff1fbcd1d5030 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 13 Jun 2000 16:48:37 +0000 Subject: * path.cc (mount_info::add_item): The previous patch can't handle the case of overwriting a mount entry. --- winsup/cygwin/path.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index f491be014..2b7e58be0 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -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)) -- cgit v1.2.3