X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:content-type
	:content-transfer-encoding:in-reply-to:references:date
	:message-id:mime-version; q=dns; s=default; b=TG3fKqlj3ZQaIZoHn3
	oSOTIIf03nHoA2fVnZ8QAWM8X14cUPUz9ZAFLGyBaO4VGwWMe3yHpcXWnBL4za6I
	vtoHdU9V4tVSXkWltWBQ7QHbiE4VzeeKEcuYgF+qkfJ/QHdY9rTMBbUx9hMjnim7
	I8IQn72Bc/EGZKFKrH/UXtq9k=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:from:to:subject:content-type
	:content-transfer-encoding:in-reply-to:references:date
	:message-id:mime-version; s=default; bh=PsXkJ34a2xHrY5nQkaSMsWlD
	tqc=; b=t2amt9jxIb1yvNwaFVxVuDhVPN/ji3I42TO3q2UxRhkLMFkYtfqoZbVQ
	q/qSiWiuoAtgwB1AyKc03OZx7h3WpYQYuEhHVm6JvzYQGv/Dv+3YM9CdR22WL/W1
	gaIfoc3XCJtqnEUoNzTbmbvJz3iSmonCp0UG3OkPTwWdaS9/uOw=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: mailout.ish.de
X-Spam-Score: -0.01
From: Helmut Karlowski <helmut.karlowski@ish.de>
To: cygwin@cygwin.com
Subject: Re: /dev/tty does not work from shell
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
In-Reply-To: <54DA32D9.5070909@redhat.com>
References: <54DA31C1.9060406@redhat.com> <54DA32D9.5070909@redhat.com>
Date: Tue, 10 Feb 2015 17:46:47 +0100
Message-Id: <20150210174647.7760EAC0.helmut.karlowski@ish.de>
MIME-Version: 1.0
X-IsSubscribed: yes


--------------------------------------------------
Eric Blake <eblake@redhat.com> wrote:
(10/02/2015 17:33)

> On 02/10/2015 09:28 AM, Eric Blake wrote:
> > 
> > The bug is in cygwin1.dll, not bash.  Here's a STC; opening a file
> > should NOT change its st_ino number, but that's exactly what cygwin is
> > doing to /dev/tty.  As such, bash thinks that because the ino changed
> > between stat() and open() that there is a race of someone trying to do
> > bad things behind bash's back, and noclobber restrictions kick in to
> > prevent bash from using the file.
> 
> The same test from the command line:
> 
> $ stat -c %i /dev/tty - 0>/dev/tty
> 327680
> 8912896
> 
> use any other (already-existing) file to see that the two numbers should
> normally be the same.

Don't know why, but cygwin is not the only OS that does that. I'd 
suggest to check for terminal or something.

-Helmut



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

