summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-06-18 09:13:16 +0000
committerpeter <peter@FreeBSD.org>1998-06-18 09:13:16 +0000
commit03956e03bf4d0ff1163421a8e9c7ac0c87414b60 (patch)
tree1ae6eb420739c5d795ae79e732def11498b83784 /lib/libc
parent700135c81985970ddb88309bb1d220c5a5119052 (diff)
downloadFreeBSD-src-03956e03bf4d0ff1163421a8e9c7ac0c87414b60.zip
FreeBSD-src-03956e03bf4d0ff1163421a8e9c7ac0c87414b60.tar.gz
preserve errno across the readlink() calls. There is no value in trashing
errno during a successful malloc() call.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/malloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 41c37f5..44cf8c0 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: malloc.c,v 1.37 1998/04/29 09:10:58 jb Exp $
+ * $Id: malloc.c,v 1.38 1998/06/09 08:30:32 jb Exp $
*
*/
@@ -380,6 +380,7 @@ malloc_init ()
{
char *p, b[64];
int i, j;
+ int errnosave;
INIT_MMAP();
@@ -389,7 +390,9 @@ malloc_init ()
for (i = 0; i < 3; i++) {
if (i == 0) {
+ errnosave = errno;
j = readlink("/etc/malloc.conf", b, sizeof b - 1);
+ errno = errnosave;
if (j <= 0)
continue;
b[j] = '\0';
OpenPOWER on IntegriCloud