From owner-svn-src-head@FreeBSD.ORG Fri Jun 28 21:47:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB79B42D; Fri, 28 Jun 2013 21:47:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD96D180D; Fri, 28 Jun 2013 21:47:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5SLl9Fm008465; Fri, 28 Jun 2013 21:47:09 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5SLl9I3008464; Fri, 28 Jun 2013 21:47:09 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201306282147.r5SLl9I3008464@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 28 Jun 2013 21:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252359 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jun 2013 21:47:09 -0000 Author: jilles Date: Fri Jun 28 21:47:08 2013 New Revision: 252359 URL: http://svnweb.freebsd.org/changeset/base/252359 Log: sh: Do not close(-1) if pipe() fails. Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Fri Jun 28 21:13:19 2013 (r252358) +++ head/bin/sh/eval.c Fri Jun 28 21:47:08 2013 (r252359) @@ -589,7 +589,8 @@ evalpipe(union node *n) pip[1] = -1; if (lp->next) { if (pipe(pip) < 0) { - close(prevfd); + if (prevfd >= 0) + close(prevfd); error("Pipe call failed: %s", strerror(errno)); } }