This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: /dev/tty does not work from shell
- From: Helmut Karlowski <helmut dot karlowski at ish dot de>
- To: cygwin at cygwin dot com
- Date: Tue, 10 Feb 2015 17:46:47 +0100
- Subject: Re: /dev/tty does not work from shell
- Authentication-results: sourceware.org; auth=none
- References: <54DA31C1 dot 9060406 at redhat dot com> <54DA32D9 dot 5070909 at redhat dot com>
--------------------------------------------------
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