about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/mach/hurd/brk.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c11ba1fe98..52cb334b49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-07-22  Mark Kettenis  <kettenis@gnu.org>
+
+	* sysdeps/mach/hurd/brk.c (_hurd_set_brk): When shrinking the
+	program's data space, reallocate only the space that was just
+	deallocated to release its backing space.
+
 2000-07-23  Ulrich Drepper  <drepper@redhat.com>
 
 	* stdio-common/vfprintf.c (process_string_arg): For wide character
diff --git a/sysdeps/mach/hurd/brk.c b/sysdeps/mach/hurd/brk.c
index c5d09a35ac..b878c1fa32 100644
--- a/sysdeps/mach/hurd/brk.c
+++ b/sysdeps/mach/hurd/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,99,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -78,7 +78,7 @@ _hurd_set_brk (vm_address_t addr)
 	  __vm_deallocate (__mach_task_self (), pagend, pagebrk - pagend);
 	  /* Now reallocate it with no access allowed.  */
 	  err = __vm_map (__mach_task_self (),
-			  &pagend, _hurd_data_end - pagend,
+			  &pagend, pagebrk - pagend,
 			  0, 0, MACH_PORT_NULL, 0, 0,
 			  0, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE,
 			  VM_INHERIT_COPY);