Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Revert last, it doesn't even build.
details: https://anonhg.NetBSD.org/src/rev/19cf5d1009d0
branches: trunk
changeset: 787319:19cf5d1009d0
user: joerg <joerg%NetBSD.org@localhost>
date: Mon Jun 10 19:07:09 2013 +0000
description:
Revert last, it doesn't even build.
diffstat:
usr.bin/make/main.c | 16 +++++++++-------
usr.bin/make/var.c | 20 +++++++++++++-------
2 files changed, 22 insertions(+), 14 deletions(-)
diffs (106 lines):
diff -r 3d68d22cef3f -r 19cf5d1009d0 usr.bin/make/main.c
--- a/usr.bin/make/main.c Mon Jun 10 18:27:30 2013 +0000
+++ b/usr.bin/make/main.c Mon Jun 10 19:07:09 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.211 2013/06/10 16:46:19 christos Exp $ */
+/* $NetBSD: main.c,v 1.212 2013/06/10 19:07:09 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.211 2013/06/10 16:46:19 christos Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.212 2013/06/10 19:07:09 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.211 2013/06/10 16:46:19 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.212 2013/06/10 19:07:09 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -937,11 +937,13 @@
* Set some other useful macros
*/
{
- char tmp[64], *ep;
+ char tmp[64];
+ const char *ep;
- snprintf(tmp, sizeof(tmp), "%d",
- (ep = getenv("MAKELEVEL")) ? atoi(ep) + 1 : 0);
- Var_Set(MAKELEVEL, tmp, VAR_GLOBAL, 0);
+ if (!(ep = getenv(MAKE_LEVEL))) {
+ ep = "0";
+ }
+ Var_Set(MAKE_LEVEL, ep, VAR_GLOBAL, 0);
snprintf(tmp, sizeof(tmp), "%u", myPid);
Var_Set(".MAKE.PID", tmp, VAR_GLOBAL, 0);
snprintf(tmp, sizeof(tmp), "%u", getppid());
diff -r 3d68d22cef3f -r 19cf5d1009d0 usr.bin/make/var.c
--- a/usr.bin/make/var.c Mon Jun 10 18:27:30 2013 +0000
+++ b/usr.bin/make/var.c Mon Jun 10 19:07:09 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.176 2013/06/10 16:46:19 christos Exp $ */
+/* $NetBSD: var.c,v 1.177 2013/06/10 19:07:09 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.176 2013/06/10 16:46:19 christos Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.177 2013/06/10 19:07:09 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.176 2013/06/10 16:46:19 christos Exp $");
+__RCSID("$NetBSD: var.c,v 1.177 2013/06/10 19:07:09 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -778,7 +778,7 @@
if (unexport_env) {
char **newenv;
- cp = getenv("MAKELEVEL"); /* we should preserve this */
+ cp = getenv(MAKE_LEVEL); /* we should preserve this */
if (environ == savedEnv) {
/* we have been here before! */
newenv = bmake_realloc(environ, 2 * sizeof(char *));
@@ -795,7 +795,7 @@
environ = savedEnv = newenv;
newenv[0] = NULL;
newenv[1] = NULL;
- setenv("MAKELEVEL", cp, 1);
+ setenv(MAKE_LEVEL, cp, 1);
} else {
for (; *str != '\n' && isspace((unsigned char) *str); str++)
continue;
@@ -960,8 +960,14 @@
* We allow the makefiles to update .MAKE.LEVEL and ensure
* children see a correctly incremented value.
*/
- if (ctxt == VAR_GLOBAL && strcmp(MAKELEVEL, name) == 0)
- setenv("MAKELEVEL", val, 1);
+ if (ctxt == VAR_GLOBAL && strcmp(MAKE_LEVEL, name) == 0) {
+ char tmp[64];
+ int level;
+
+ level = atoi(val);
+ snprintf(tmp, sizeof(tmp), "%u", level + 1);
+ setenv(MAKE_LEVEL, tmp, 1);
+ }
out:
Home |
Main Index |
Thread Index |
Old Index