summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>1997-08-22 17:06:59 +0000
committerderaadt <>1997-08-22 17:06:59 +0000
commit7cf0a9096ed9b087d6bf9c23fadee9eba456f4e3 (patch)
treec55a49b152425f0dd45ada90ca402974da057342 /src
parentd9e9dd15aef27c2a7246403ea76898fa1a4c061a (diff)
downloadopenbsd-7cf0a9096ed9b087d6bf9c23fadee9eba456f4e3.tar.gz
openbsd-7cf0a9096ed9b087d6bf9c23fadee9eba456f4e3.tar.bz2
openbsd-7cf0a9096ed9b087d6bf9c23fadee9eba456f4e3.zip
malloc_init() should try to not modify errno
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index 9d9c69ad00..12cc67083d 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#if defined(LIBC_SCCS) && !defined(lint) 10#if defined(LIBC_SCCS) && !defined(lint)
11static char rcsid[] = "$OpenBSD: malloc.c,v 1.27 1997/07/02 16:26:27 millert Exp $"; 11static char rcsid[] = "$OpenBSD: malloc.c,v 1.28 1997/08/22 17:06:59 deraadt Exp $";
12#endif /* LIBC_SCCS and not lint */ 12#endif /* LIBC_SCCS and not lint */
13 13
14/* 14/*
@@ -478,6 +478,7 @@ malloc_init ()
478{ 478{
479 char *p, b[64]; 479 char *p, b[64];
480 int i, j; 480 int i, j;
481 int save_errno = errno;
481 482
482 THREAD_LOCK_INIT(); 483 THREAD_LOCK_INIT();
483 484
@@ -584,7 +585,7 @@ malloc_init ()
584 * We can sbrk(2) further back when we keep this on a low address. 585 * We can sbrk(2) further back when we keep this on a low address.
585 */ 586 */
586 px = (struct pgfree *) imalloc (sizeof *px); 587 px = (struct pgfree *) imalloc (sizeof *px);
587 588 errno = save_errno;
588} 589}
589 590
590/* 591/*