From owner-freebsd-current Thu Jan 1 08:04:44 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id IAA18042 for current-outgoing; Thu, 1 Jan 1998 08:04:44 -0800 (PST) (envelope-from owner-freebsd-current) Received: from post.mail.demon.net (post-20.mail.demon.net [194.217.242.27]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id IAA18036 for ; Thu, 1 Jan 1998 08:04:38 -0800 (PST) (envelope-from fcurrent@jraynard.demon.co.uk) Received: from jraynard.demon.co.uk ([158.152.42.77]) by post.mail.demon.net id aa2009669; 1 Jan 98 16:03 GMT Received: (from fcurrent@localhost) by jraynard.demon.co.uk (8.8.8/8.8.8) id NAA02357; Thu, 1 Jan 1998 13:56:55 GMT (envelope-from fcurrent) Message-ID: <19980101135653.51937@jraynard.demon.co.uk> Date: Thu, 1 Jan 1998 13:56:53 +0000 From: James Raynard To: Bruce Evans Cc: freebsd-current@freebsd.org Subject: Re: make -j install doesn't work in src/include References: <199801010621.RAA08655@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199801010621.RAA08655@godzilla.zeta.org.au>; from Bruce Evans on Thu, Jan 01, 1998 at 05:21:14PM +1100 Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, Jan 01, 1998 at 05:21:14PM +1100, Bruce Evans wrote: > > No, make's current directory is always ${.OBJDIR} (except for a short > time when it starts up). ${.CURDIR} gives the directory where make > started up. Sorry, I should have RTFMed first. On the subject of make -j install, it doesn't work in bin either, as there's a window where /bin/sh has been installed but hasn't been made executable. The following patch works around this: Index: job.c =================================================================== RCS file: /home/cvs/src/usr.bin/make/job.c,v retrieving revision 1.7 diff -u -r1.7 job.c --- job.c 1997/02/22 19:27:11 1.7 +++ job.c 1998/01/01 13:16:21 @@ -1269,6 +1269,10 @@ #endif /* REMOTE */ (void) execv(shellPath, argv); + if (errno == EACCES) { + sleep(1); + (void) execv(shellPath, argv); + } (void) write(2, "Could not execute shell\n", sizeof("Could not execute shell")); _exit(1); Index: main.c =================================================================== RCS file: /home/cvs/src/usr.bin/make/main.c,v retrieving revision 1.23 diff -u -r1.23 main.c --- main.c 1997/09/29 03:53:51 1.23 +++ main.c 1998/01/01 13:19:37 @@ -928,6 +928,10 @@ (void) close(fds[1]); (void) execv("/bin/sh", args); + if (errno == EACCES) { + sleep(1); + (void) execv("/bin/sh", args); + } _exit(1); /*NOTREACHED*/ Is there any better way of doing this? I can see it failing under very heavy load, for example. -- In theory, theory is better than practice. In practice, it isn't. James Raynard, Edinburgh, Scotland. http://www.freebsd.org/~jraynard/