diff options
author | 2003-07-19 23:52:27 +0000 | |
---|---|---|
committer | 2003-07-19 23:52:27 +0000 | |
commit | b6cd67b3f6289bb455e6c0da46fb97b0fc5cb0d6 (patch) | |
tree | 401bc7a08b5d0002ce26d628373c93f7795de0aa /lib/libc/stdlib/malloc.c | |
parent | Remove bullshit: hpt366 rev. 1 is hpt366, not hpt372a. (diff) | |
download | wireguard-openbsd-b6cd67b3f6289bb455e6c0da46fb97b0fc5cb0d6.tar.xz wireguard-openbsd-b6cd67b3f6289bb455e6c0da46fb97b0fc5cb0d6.zip |
- just warn in case of mmap/brk failure
- extend_pgdir and malloc_make_chunks return int, not void*
ok tedu@
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 3ce107857a4..9d73ab021dd 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: malloc.c,v 1.57 2003/07/13 08:35:44 otto Exp $"; +static char rcsid[] = "$OpenBSD: malloc.c,v 1.58 2003/07/19 23:52:27 tdeval Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -385,7 +385,7 @@ map_pages(pages) pages <<= malloc_pageshift; if (pages > SIZE_T_MAX - (size_t)result) { #ifdef MALLOC_EXTRA_SANITY - wrterror("(ES): overflow in map_pages fails\n"); + wrtwarning("(ES): overflow in map_pages fails\n"); #endif /* MALLOC_EXTRA_SANITY */ errno = ENOMEM; return (NULL); @@ -394,7 +394,7 @@ map_pages(pages) if (brk(tail) == (char *)-1) { #ifdef MALLOC_EXTRA_SANITY - wrterror("(ES): map_pages fails\n"); + wrtwarning("(ES): map_pages fails\n"); #endif /* MALLOC_EXTRA_SANITY */ return (NULL); } @@ -402,7 +402,7 @@ map_pages(pages) last_index = ptr2index(tail) - 1; malloc_brk = tail; - if ((last_index+1) >= malloc_ninfo && extend_pgdir(last_index) == NULL) + if ((last_index+1) >= malloc_ninfo && !extend_pgdir(last_index)) return (NULL); return (result); @@ -790,7 +790,7 @@ malloc_bytes(size) } /* If it's empty, make a page more of that size chunks */ - if (page_dir[j] == NULL && malloc_make_chunks(j) == NULL) + if (page_dir[j] == NULL && !malloc_make_chunks(j)) return (NULL); bp = page_dir[j]; |