diff options
author | deraadt <> | 1997-08-22 17:06:59 +0000 |
---|---|---|
committer | deraadt <> | 1997-08-22 17:06:59 +0000 |
commit | 7cf0a9096ed9b087d6bf9c23fadee9eba456f4e3 (patch) | |
tree | c55a49b152425f0dd45ada90ca402974da057342 /src | |
parent | d9e9dd15aef27c2a7246403ea76898fa1a4c061a (diff) | |
download | openbsd-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.c | 5 |
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) |
11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.27 1997/07/02 16:26:27 millert Exp $"; | 11 | static 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 | /* |