Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Do not use an objdir that is not writable.



details:   https://anonhg.NetBSD.org/src/rev/c8c0df154e22
branches:  trunk
changeset: 1015717:c8c0df154e22
user:      sjg <sjg%NetBSD.org@localhost>
date:      Sat Oct 31 06:18:21 2020 +0000

description:
Do not use an objdir that is not writable.

diffstat:

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

diffs (27 lines):

diff -r 96a9ad7dad88 -r c8c0df154e22 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sat Oct 31 04:05:42 2020 +0000
+++ b/usr.bin/make/main.c       Sat Oct 31 06:18:21 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.412 2020/10/30 20:30:44 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.413 2020/10/31 06:18:21 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.412 2020/10/30 20:30:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.413 2020/10/31 06:18:21 sjg Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -721,7 +721,7 @@
 
        /* look for the directory and try to chdir there */
        if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
-               if (chdir(path)) {
+               if (access(path, W_OK) || chdir(path)) {
                        (void)fprintf(stderr, "make warning: %s: %s.\n",
                                      path, strerror(errno));
                } else {



Home | Main Index | Thread Index | Old Index