diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b0c3d7540..4bca458c2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-09-26 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (munmap): Use correct address and length parameters when + calling fhandler's munmap. + 2003-09-26 Corinna Vinschen <corinna@vinschen.de> * spawn.cc (spawn_guts): Set errno to E2BIG if command line is 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,