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 bogus patch that attempted to canonicali...



details:   https://anonhg.NetBSD.org/src/rev/c7a342478f2c
branches:  trunk
changeset: 754598:c7a342478f2c
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 05 14:10:39 2010 +0000

description:
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!

diffstat:

 usr.bin/make/main.c |  15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diffs (43 lines):

diff -r acb2f2e2173a -r c7a342478f2c usr.bin/make/main.c
--- a/usr.bin/make/main.c       Wed May 05 13:27:17 2010 +0000
+++ b/usr.bin/make/main.c       Wed May 05 14:10:39 2010 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index