Date: Fri, 28 Jun 2013 21:47:09 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252359 - head/bin/sh Message-ID: <201306282147.r5SLl9I3008464@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306282147.r5SLl9I3008464>