summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdlib/malloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index 3cdacc59b9..45a8cc8182 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.51 2002/11/05 22:19:55 marc Exp $"; 11static char rcsid[] = "$OpenBSD: malloc.c,v 1.52 2002/11/25 00:06:51 cloder Exp $";
12#endif /* LIBC_SCCS and not lint */ 12#endif /* LIBC_SCCS and not lint */
13 13
14/* 14/*
@@ -364,9 +364,9 @@ malloc_exit()
364 char *q = "malloc() warning: Couldn't dump stats.\n"; 364 char *q = "malloc() warning: Couldn't dump stats.\n";
365 if (fd) { 365 if (fd) {
366 malloc_dump(fd); 366 malloc_dump(fd);
367 fclose(fd); 367 fclose(fd);
368 } else 368 } else
369 write(2, q, strlen(q)); 369 write(STDERR_FILENO, q, strlen(q));
370} 370}
371#endif /* MALLOC_STATS */ 371#endif /* MALLOC_STATS */
372 372
@@ -534,8 +534,8 @@ malloc_init ()
534 malloc_junk=1; 534 malloc_junk=1;
535 535
536#ifdef MALLOC_STATS 536#ifdef MALLOC_STATS
537 if (malloc_stats) 537 if (malloc_stats && (atexit(malloc_exit) == -1))
538 atexit(malloc_exit); 538 wrtwarning("atexit(2) failed. Will not be able to dump malloc stats on exit.\n");
539#endif /* MALLOC_STATS */ 539#endif /* MALLOC_STATS */
540 540
541 /* Allocate one page for the page directory */ 541 /* Allocate one page for the page directory */