Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2001 00:03:42 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        <babkin@FreeBSD.org>
Cc:        Erik Trulsson <ertr1013@student.uu.se>, Steve Price <steve@FreeBSD.org>, Andreas Klemm <andreas@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: sh patch Re: cvs commit: ports/print/apsfilter Makefile  ports/print/apsfilter/files patch-bin::aps2file  ports/print/apsfilter/scripts pre-configure
Message-ID:  <20011222000107.C4679-100000@gamplex.bde.org>
In-Reply-To: <3C22A104.C0953230@bellatlantic.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 20 Dec 2001, Sergey Babkin wrote:

> 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.

> --- 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);
>  		}

This seems to introduce a race by moving the close after the INTON.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011222000107.C4679-100000>