From owner-svn-src-all@freebsd.org Mon Jul 24 00:52:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEBA6DB2393; Mon, 24 Jul 2017 00:52:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFF2775215; Mon, 24 Jul 2017 00:52:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6O0qrMJ001006; Mon, 24 Jul 2017 00:52:53 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6O0qrnl001000; Mon, 24 Jul 2017 00:52:53 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201707240052.v6O0qrnl001000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 24 Jul 2017 00:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321402 - vendor/NetBSD/bmake/dist X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/dist X-SVN-Commit-Revision: 321402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2017 00:52:55 -0000 Author: sjg Date: Mon Jul 24 00:52:52 2017 New Revision: 321402 URL: https://svnweb.freebsd.org/changeset/base/321402 Log: Import bmake-20170720 compat.c: pass SIGINT etc onto child and wait for it to exit before we self-terminate. Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/nonints.h Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Sun Jul 23 22:38:00 2017 (r321401) +++ vendor/NetBSD/bmake/dist/ChangeLog Mon Jul 24 00:52:52 2017 (r321402) @@ -1,3 +1,10 @@ +2017-07-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170720 + Merge with NetBSD make, pick up + o compat.c: pass SIGINT etc onto child and wait for it to exit + before we self-terminate. + 2017-07-11 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170711 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Sun Jul 23 22:38:00 2017 (r321401) +++ vendor/NetBSD/bmake/dist/Makefile Mon Jul 24 00:52:52 2017 (r321402) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.94 2017/07/15 18:22:14 sjg Exp $ +# $Id: Makefile,v 1.95 2017/07/20 19:36:13 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170711 +_MAKE_VERSION= 20170720 PROG= bmake Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Sun Jul 23 22:38:00 2017 (r321401) +++ vendor/NetBSD/bmake/dist/compat.c Mon Jul 24 00:52:52 2017 (r321402) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $ */ +/* $NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"); +__RCSID("$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -118,6 +118,8 @@ __RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 static GNode *curTarg = NULL; static GNode *ENDNode; static void CompatInterrupt(int); +static pid_t compatChild; +static int compatSigno; /* * CompatDeleteTarget -- delete a failed, interrupted, or otherwise @@ -176,8 +178,17 @@ CompatInterrupt(int signo) } if (signo == SIGQUIT) _exit(signo); - bmake_signal(signo, SIG_DFL); - kill(myPid, signo); + /* + * If there is a child running, pass the signal on + * we will exist after it has exited. + */ + compatSigno = signo; + if (compatChild > 0) { + KILLPG(compatChild, signo); + } else { + bmake_signal(signo, SIG_DFL); + kill(myPid, signo); + } } /*- @@ -370,7 +381,7 @@ again: /* * Fork and execute the single command. If the fork fails, we abort. */ - cpid = vFork(); + compatChild = cpid = vFork(); if (cpid < 0) { Fatal("Could not fork"); } @@ -483,7 +494,12 @@ again: } } free(cmdStart); - + compatChild = 0; + if (compatSigno) { + bmake_signal(compatSigno, SIG_DFL); + kill(myPid, compatSigno); + } + return (status); } Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Sun Jul 23 22:38:00 2017 (r321401) +++ vendor/NetBSD/bmake/dist/job.c Mon Jul 24 00:52:52 2017 (r321402) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $ */ +/* $NetBSD: job.c,v 1.191 2017/07/20 19:29:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.191 2017/07/20 19:29:54 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"); +__RCSID("$NetBSD: job.c,v 1.191 2017/07/20 19:29:54 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -348,11 +348,6 @@ static Job childExitJob; /* child exit pseudo-job */ (void)fprintf(fp, TARG_FMT, targPrefix, gn->name) static sigset_t caught_signals; /* Set of signals we handle */ -#if defined(SYSV) -#define KILLPG(pid, sig) kill(-(pid), (sig)) -#else -#define KILLPG(pid, sig) killpg((pid), (sig)) -#endif static void JobChildSig(int); static void JobContinueSig(int); Modified: vendor/NetBSD/bmake/dist/make.h ============================================================================== --- vendor/NetBSD/bmake/dist/make.h Sun Jul 23 22:38:00 2017 (r321401) +++ vendor/NetBSD/bmake/dist/make.h Mon Jul 24 00:52:52 2017 (r321402) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.102 2016/12/07 15:00:46 christos Exp $ */ +/* $NetBSD: make.h,v 1.103 2017/07/20 19:29:54 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -541,6 +541,12 @@ int cached_stat(const char *, void *); #endif #ifndef PATH_MAX #define PATH_MAX MAXPATHLEN +#endif + +#if defined(SYSV) +#define KILLPG(pid, sig) kill(-(pid), (sig)) +#else +#define KILLPG(pid, sig) killpg((pid), (sig)) #endif #endif /* _MAKE_H_ */ Modified: vendor/NetBSD/bmake/dist/nonints.h ============================================================================== --- vendor/NetBSD/bmake/dist/nonints.h Sun Jul 23 22:38:00 2017 (r321401) +++ vendor/NetBSD/bmake/dist/nonints.h Mon Jul 24 00:52:52 2017 (r321402) @@ -143,6 +143,11 @@ int Str_Match(const char *, const char *); char *Str_SYSVMatch(const char *, const char *, int *len); void Str_SYSVSubst(Buffer *, char *, char *, int); +#ifndef HAVE_STRLCPY +/* strlcpy.c */ +size_t strlcpy(char *, const char *, size_t); +#endif + /* suff.c */ void Suff_ClearSuffixes(void); Boolean Suff_IsTransform(char *);