Module Name: src
Committed By: christos
Date: Wed May 5 14:10:39 UTC 2010
Modified Files:
src/usr.bin/make: main.c
Log Message:
Revert bogus patch that attempted to canonicalize a non absolute argv[0] using
realpath(3). Consider: touch Makefile; mkdir make; make. This will set $MAKE
to $PWD/make so further attempts to use ${MAKE} will try to execute the
directory. This needs $ORIGIN to be fixed properly, or alternatively one
can duplicate the logic for execvp(3) and search the path for the make
executable. Not worth it. It was working just fine before!
To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.184 src/usr.bin/make/main.c:1.185
--- src/usr.bin/make/main.c:1.184 Thu Apr 29 19:12:21 2010
+++ src/usr.bin/make/main.c Wed May 5 10:10:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.184 2010/04/29 23:12:21 sjg Exp $ */
+/* $NetBSD: main.c,v 1.185 2010/05/05 14:10:39 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.184 2010/04/29 23:12:21 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.185 2010/05/05 14:10:39 christos 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.184 2010/04/29 23:12:21 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.185 2010/05/05 14:10:39 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -900,14 +900,7 @@
* MFLAGS also gets initialized empty, for compatibility.
*/
Parse_Init();
- if (argv[0][0] == '/') {
- p1 = argv[0];
- } else {
- p1 = realpath(argv[0], mdpath);
- if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) {
- p1 = argv[0]; /* realpath failed */
- }
- }
+ p1 = argv[0];
Var_Set("MAKE", p1, VAR_GLOBAL, 0);
Var_Set(".MAKE", p1, VAR_GLOBAL, 0);
Var_Set(MAKEFLAGS, "", VAR_GLOBAL, 0);