Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Many C libraries don't set errno when malloc fa...



details:   https://anonhg.NetBSD.org/src/rev/c23544fa1ff4
branches:  trunk
changeset: 760072:c23544fa1ff4
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Dec 25 20:35:25 2010 +0000

description:
Many C libraries don't set errno when malloc fails, so always use
strerror(ENOMEM).

diffstat:

 usr.bin/make/make_malloc.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ed811d7b6f46 -r c23544fa1ff4 usr.bin/make/make_malloc.c
--- a/usr.bin/make/make_malloc.c        Sat Dec 25 20:34:08 2010 +0000
+++ b/usr.bin/make/make_malloc.c        Sat Dec 25 20:35:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.c,v 1.5 2009/01/24 23:19:50 dsl Exp $      */
+/*     $NetBSD: make_malloc.c,v 1.6 2010/12/25 20:35:25 dholland Exp $ */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #ifdef MAKE_NATIVE
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: make_malloc.c,v 1.5 2009/01/24 23:19:50 dsl Exp $");
+__RCSID("$NetBSD: make_malloc.c,v 1.6 2010/12/25 20:35:25 dholland Exp $");
 #endif
 
 #include <stdio.h>
@@ -48,7 +48,7 @@
 {
        extern char *progname;
 
-       (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
+       (void)fprintf(stderr, "%s: %s.\n", progname, strerror(ENOMEM));
        exit(2);
 }
 



Home | Main Index | Thread Index | Old Index