Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Jan 1998 13:56:53 +0000
From:      James Raynard <fcurrent@jraynard.demon.co.uk>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-current@freebsd.org
Subject:   Re: make -j install doesn't work in src/include
Message-ID:  <19980101135653.51937@jraynard.demon.co.uk>
In-Reply-To: <199801010621.RAA08655@godzilla.zeta.org.au>; from Bruce Evans on Thu, Jan 01, 1998 at 05:21:14PM %2B1100
References:  <199801010621.RAA08655@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980101135653.51937>