summaryrefslogtreecommitdiff
path: root/libstore/gunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libstore/gunzip.c')
-rw-r--r--libstore/gunzip.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libstore/gunzip.c b/libstore/gunzip.c
index 230ce1b0..261baee3 100644
--- a/libstore/gunzip.c
+++ b/libstore/gunzip.c
@@ -1,6 +1,6 @@
/* Decompressing store backend
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This file is part of the GNU Hurd.
@@ -108,8 +108,7 @@ gunzip (struct store *from, void **buf, size_t *buf_len)
if (new_in_buf != in_buf)
{
if (in_buf_len > 0)
- vm_deallocate (mach_task_self (),
- (vm_address_t)in_buf, in_buf_len);
+ munmap (in_buf, in_buf_len);
in_buf = new_in_buf;
in_buf_len = new_in_buf_len;
}
@@ -153,8 +152,7 @@ gunzip (struct store *from, void **buf, size_t *buf_len)
/* Copy the old buffer into the start of the new & free it. */
bcopy (old_buf, new_buf, out_buf_offs);
- vm_deallocate (mach_task_self (),
- (vm_address_t)old_buf, old_buf_len);
+ munmap (old_buf, old_buf_len);
*buf = new_buf;
}
@@ -209,20 +207,19 @@ gunzip (struct store *from, void **buf, size_t *buf_len)
mutex_unlock (&unzip_lock);
if (in_buf_len > 0)
- vm_deallocate (mach_task_self (), (vm_address_t)in_buf, in_buf_len);
+ munmap (in_buf, in_buf_len);
if (zerr)
{
if (*buf_len > 0)
- vm_deallocate (mach_task_self (), (vm_address_t)*buf, *buf_len);
+ munmap (*buf, *buf_len);
}
else if (out_buf_offs < *buf_len)
/* Trim the output buffer to be the right length. */
{
size_t end = round_page (out_buf_offs);
if (end < *buf_len)
- vm_deallocate (mach_task_self (),
- (vm_address_t)(*buf + end), *buf_len - end);
+ munmap (*buf + end, *buf_len - end);
*buf_len = out_buf_offs;
}
@@ -242,7 +239,7 @@ store_gunzip_create (struct store *from, int flags, struct store **store)
{
err = store_buffer_create (buf, buf_len, flags, store);
if (err)
- vm_deallocate (mach_task_self (), (vm_address_t)buf, buf_len);
+ munmap (buf, buf_len);
else
store_free (from);
}