From 186a0e42de9b19d267e2b5bb1f1ff108e2d9ae36 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 26 Sep 2003 08:50:12 +0000 Subject: * mmap.cc (munmap): Use correct address and length parameters when calling fhandler's munmap. --- winsup/cygwin/mmap.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/mmap.cc') diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 5ed774273..79014310e 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -679,12 +679,15 @@ munmap (void *addr, size_t len) mmap_record *rec = map_list->get_record (record_idx); if (rec->unmap_pages (u_addr, u_len)) { - /* The whole record has been unmapped, so... */ + /* The whole record has been unmapped, so we now actually + unmap it from the system in full length... */ fhandler_base *fh = rec->alloc_fh (); - fh->munmap (rec->get_handle (), (caddr_t)addr, len); + fh->munmap (rec->get_handle (), + rec->get_address (), + rec->get_size ()); rec->free_fh (fh); - /* ...delete the record. */ + /* ...and delete the record. */ if (map_list->del_record (record_idx--)) { /* Yay, the last record has been removed from the list, -- cgit v1.2.3