From f8d6aa2c68cde828f5ded3592b10903ba2a44f91 Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 25 Dec 2010 20:35:25 +0000 Subject: [PATCH] Many C libraries don't set errno when malloc fails, so always use strerror(ENOMEM). --- usr.bin/make/make_malloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/make/make_malloc.c b/usr.bin/make/make_malloc.c index ac90d265fa65..f0ccbc44bdaf 100644 --- a/usr.bin/make/make_malloc.c +++ b/usr.bin/make/make_malloc.c @@ -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 -__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 @@ -48,7 +48,7 @@ enomem(void) { extern char *progname; - (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); + (void)fprintf(stderr, "%s: %s.\n", progname, strerror(ENOMEM)); exit(2); }