Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make On some systems realpath will prefix make with ...



details:   https://anonhg.NetBSD.org/src/rev/1cf278c1148c
branches:  trunk
changeset: 754109:1cf278c1148c
user:      sjg <sjg%NetBSD.org@localhost>
date:      Tue Apr 20 17:18:08 2010 +0000

description:
On some systems realpath will prefix make with cwd, so make sure
we can stat(2) the value for .MAKE

diffstat:

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

diffs (36 lines):

diff -r 78ff0ea25545 -r 1cf278c1148c usr.bin/make/main.c
--- a/usr.bin/make/main.c       Tue Apr 20 16:49:48 2010 +0000
+++ b/usr.bin/make/main.c       Tue Apr 20 17:18:08 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.178 2010/04/14 16:16:17 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.179 2010/04/20 17:18:08 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.178 2010/04/14 16:16:17 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.179 2010/04/20 17:18:08 sjg 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.178 2010/04/14 16:16:17 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.179 2010/04/20 17:18:08 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -899,7 +899,7 @@
            p1 = argv[0];
        } else {
            p1 = realpath(argv[0], mdpath);
-           if (!p1 || *p1 != '/') {
+           if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) {
                p1 = argv[0];           /* realpath failed */
            }
        }



Home | Main Index | Thread Index | Old Index