From owner-cvs-src-old@FreeBSD.ORG Sat Jun 13 21:18:08 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 C79CA1065670 for ; Sat, 13 Jun 2009 21:18:08 +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 B472A8FC25 for ; Sat, 13 Jun 2009 21:18:08 +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 n5DLI8IC078728 for ; Sat, 13 Jun 2009 21:18:08 GMT (envelope-from jilles@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5DLI81N078727 for cvs-src-old@freebsd.org; Sat, 13 Jun 2009 21:18:08 GMT (envelope-from jilles@repoman.freebsd.org) Message-Id: <200906132118.n5DLI81N078727@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jilles@repoman.freebsd.org using -f From: Jilles Tjoelker Date: Sat, 13 Jun 2009 21:17:45 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/bin/sh eval.c eval.h input.c input.h main.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: Sat, 13 Jun 2009 21:18:09 -0000 jilles 2009-06-13 21:17:45 UTC FreeBSD src repository Modified files: bin/sh eval.c eval.h input.c input.h main.c Log: SVN rev 194128 on 2009-06-13 21:17:45Z by jilles Avoid leaving unnecessary waiting shells in many forms of sh -c COMMAND. This change only affects strings passed to -c, when the -s option is not used. The approach is to check if there may be additional data in the string after parsing each command. If there is none, use the EV_EXIT flag so that a fork may be omitted in specific cases. If there are empty lines after the command, the check will not see the end and forks will not be omitted. The same thing seems to happen in bash. Example: sh -c 'ps lT' No longer shows a shell process waiting for ps to finish. PR: bin/113860 Reviewed by: stefanf Approved by: ed (mentor) Revision Changes Path 1.61 +11 -8 src/bin/sh/eval.c 1.13 +5 -0 src/bin/sh/eval.h 1.24 +17 -0 src/bin/sh/input.c 1.10 +1 -0 src/bin/sh/input.h 1.31 +1 -1 src/bin/sh/main.c