Author: sthibault
Date: 2009-09-14 04:57:15 +0000 (Mon, 14 Sep 2009)
New Revision: 3838

Modified:
   glibc-package/trunk/debian/patches/hurd-i386/submitted-sbrk.diff
Log:
fix patch into really working


Modified: glibc-package/trunk/debian/patches/hurd-i386/submitted-sbrk.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/submitted-sbrk.diff    
2009-09-13 23:06:28 UTC (rev 3837)
+++ glibc-package/trunk/debian/patches/hurd-i386/submitted-sbrk.diff    
2009-09-14 04:57:15 UTC (rev 3838)
@@ -4,22 +4,34 @@
         instead of pagebrk to __vm_allocate.
 
 ---
- brk.c |    4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ brk.c |   16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
 
 diff --git a/sysdeps/mach/hurd/brk.c b/sysdeps/mach/hurd/brk.c
-index 931b260..087dbdd 100644
+index 931b260..678b1bb 100644
 --- a/sysdeps/mach/hurd/brk.c
 +++ b/sysdeps/mach/hurd/brk.c
-@@ -101,8 +101,10 @@ _hurd_set_brk (vm_address_t addr)
+@@ -101,8 +101,22 @@ _hurd_set_brk (vm_address_t addr)
  
    if (pagend > _hurd_data_end)
      {
 +      vm_address_t alloc_start = _hurd_data_end;
++
        /* We didn't allocate enough space!  Hopefully we can get some more!  */
 -      err = __vm_allocate (__mach_task_self (), &pagebrk, pagend - pagebrk, 
0);
-+      err = __vm_allocate (__mach_task_self (), &alloc_start,
-+                         pagend - alloc_start, 0);
++
++      if (_hurd_data_end > pagebrk)
++      /* First finish allocation */
++      err = __vm_protect (__mach_task_self (), pagebrk,
++                          alloc_start - pagebrk, 0,
++                          VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
++      if (! err)
++      _hurd_brk = alloc_start;
++
++      if (! err)
++      err = __vm_allocate (__mach_task_self (), &alloc_start,
++                           pagend - alloc_start, 0);
++
        if (! err)
        _hurd_data_end = pagend;
      }


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to