From owner-cvs-all Thu Dec 20 18:40:20 2001 Delivered-To: cvs-all@freebsd.org Received: from smtp001pub.verizon.net (smtp001pub.verizon.net [206.46.170.180]) by hub.freebsd.org (Postfix) with ESMTP id C26FD37B405; Thu, 20 Dec 2001 18:40:10 -0800 (PST) Received: from bellatlantic.net (pool-151-198-135-167.mad.east.verizon.net [151.198.135.167]) by smtp001pub.verizon.net with ESMTP ; id fBL2e5p14577 Thu, 20 Dec 2001 20:40:05 -0600 (CST) Message-ID: <3C22A104.C0953230@bellatlantic.net> Date: Thu, 20 Dec 2001 21:40:04 -0500 From: Sergey Babkin Reply-To: babkin@freebsd.org X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.0-19990626-CURRENT i386) X-Accept-Language: en, ru MIME-Version: 1.0 To: Erik Trulsson Cc: Steve Price , Andreas Klemm , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: sh patch Re: cvs commit: ports/print/apsfilter Makefile ports/print/apsfilter/files patch-bin::aps2file ports/print/apsfilter/scripts pre-configure References: <200112171847.fBHIlbP69769@freefall.freebsd.org> <20011217130555.J72144@bsd.havk.org> <20011217201850.A21347@student.uu.se> <3C1FE5AF.5E93ED0D@bellatlantic.net> Content-Type: multipart/mixed; boundary="------------2CFE277C42EAE45E1A35A8F3" Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------2CFE277C42EAE45E1A35A8F3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I wrote a patch that makes /bin/sh redirection to stdout work (attached, apply in src/bin/sh). Please review it and/or test it and let me know, and I'll commit it to -current. -SB > Erik Trulsson wrote: > > > > On Mon, Dec 17, 2001 at 01:05:55PM -0600, Steve Price wrote: > > > On Mon, Dec 17, 2001 at 10:47:37AM -0800, Andreas Klemm wrote: > > > > Log: > > > > Unluckily FreeBSD's shell isn't able to read from/write to /dev/stdin > > > > and stdout. > > > > > > Perhaps I missed the discussion somewhere else but can you please > > > explain what this means and give an example of a short script that > > > doesn't work with /bin/sh? > > > > Just try the following command: > > > > echo "hello" > /dev/stdout --------------2CFE277C42EAE45E1A35A8F3 Content-Type: text/plain; charset=us-ascii; name="redir.df" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="redir.df" --- redir.c 2001/12/21 02:11:14 1.1 +++ redir.c 2001/12/21 02:30:03 @@ -145,11 +145,8 @@ } if (!try) { sv->renamed[fd] = i; - close(fd); } INTON; - } else { - close(fd); } if (fd == 0) fd0_redirected++; @@ -186,6 +183,7 @@ error("cannot open %s: %s", fname, errmsg(errno, E_OPEN)); movefd: if (f != fd) { + close(fd); copyfd(f, fd); close(f); } --------------2CFE277C42EAE45E1A35A8F3-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message