From owner-freebsd-current Sun Jan 4 10:47:09 1998 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA14349 for current-outgoing; Sun, 4 Jan 1998 10:47:09 -0800 (PST) (envelope-from owner-freebsd-current) Received: from post.mail.demon.net (post-10.mail.demon.net [194.217.242.154]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id KAA14293 for ; Sun, 4 Jan 1998 10:46:23 -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 aa1003730; 4 Jan 98 18:44 GMT Received: (from fcurrent@localhost) by jraynard.demon.co.uk (8.8.8/8.8.8) id SAA01951; Sun, 4 Jan 1998 18:03:17 GMT (envelope-from fcurrent) Message-ID: <19980104180316.06571@jraynard.demon.co.uk> Date: Sun, 4 Jan 1998 18:03:16 +0000 From: James Raynard To: freebsd-current@freebsd.org Subject: make -j install fix Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Having investigated this a little more, I think the following is better than the diff I posted a few days ago (there seems to be a window where /bin/sh isn't there and execv() returns ENOENT - also one second seems a little short to sleep). Comments? 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/04 17:53:04 @@ -1269,6 +1269,17 @@ #endif /* REMOTE */ (void) execv(shellPath, argv); + /* + * When using the -j option to install /bin, there + * is a possibility the above call will fail if + * /bin/sh was being installed at the same time as this + * target. To avoid this, we sleep for a few seconds + * and retry. + */ + if (errno == EACCES || errno == ENOENT) { + (void) sleep(3); + (void) execv(shellPath, argv); + } (void) write(2, "Could not execute shell\n", sizeof("Could not execute shell")); _exit(1); -- In theory, theory is better than practice. In practice, it isn't. James Raynard, Edinburgh, Scotland. http://www.freebsd.org/~jraynard/