From owner-cvs-src-old@FreeBSD.ORG Tue Jun 23 21:50:26 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9621065696 for ; Tue, 23 Jun 2009 21:50:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 779CB8FC18 for ; Tue, 23 Jun 2009 21:50:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5NLoQep074889 for ; Tue, 23 Jun 2009 21:50:26 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5NLoQLX074888 for cvs-src-old@freebsd.org; Tue, 23 Jun 2009 21:50:26 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <200906232150.n5NLoQLX074888@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Tue, 23 Jun 2009 21:50:06 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh eval.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2009 21:50:26 -0000 jilles 2009-06-23 21:50:06 UTC FreeBSD src repository Modified files: bin/sh eval.c Log: SVN rev 194774 on 2009-06-23 21:50:06Z by jilles Do not fork for a subshell if it is the last thing this shell is doing (EV_EXIT). The fork is still done as normal if any traps are active. In many cases, the fork can be avoided even without this change by using {} instead of (), but in practice many scripts use (), likely because the syntax is simpler. Example: sh -c '(/bin/sleep 10)& sleep 1;ps -p $! -o comm=' Now prints "sleep" instead of "sh". $! is more useful this way. Most shells (dash, bash, pdksh, ksh93, zsh) seem to print "sleep" for this. Example: sh -c '( ( ( (ps jT))))' Now shows no waiting shell processes instead of four. Most shells (dash, bash, pdksh, ksh93, zsh) seem to show zero or one. PR: bin/74404 Approved by: ed (mentor) (implicit) Revision Changes Path 1.63 +2 -2 src/bin/sh/eval.c