delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/25/10:49:31

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Thu, 25 Jan 2001 10:34:57 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: ncftp - works, but doesn't display any prompts
Message-ID: <20010125103457.B29828@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin <cygwin AT cygwin DOT com>
References: <LNBBKMIKMNGEJNEJICPHGENKELAA DOT stanton AT haas DOT berkeley DOT edu> <3A6F78D8 DOT CBEA38E9 AT ece DOT gatech DOT edu> <20010125160909 DOT A1058 AT cobold DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <20010125160909.A1058@cobold.vinschen.de>; from cygwin@cygwin.com on Thu, Jan 25, 2001 at 04:09:09PM +0100

On Thu, Jan 25, 2001 at 04:09:09PM +0100, Corinna Vinschen wrote:
>On Wed, Jan 24, 2001 at 07:52:40PM -0500, Charles Wilson wrote:
>> This is a bug in ncftp or cygwin.  If ncftp determines that it is not
>> running from a TTY, it doesn't print any prompts.  Here's the code that
>> it uses to determine that (ncftp/main.c):
>> 
>>         gIsTTY = ((isatty(2) != 0) && (getppid() > 1)) ? 1 : 0;
>>         gIsTTYr = ((isatty(0) != 0) && (getppid() > 1)) ? 1 : 0;
>> 
>> Here's the result of those operations in a bash window:
>> isatty(2) = 1
>> isatty(0) = 1
>> getppid() = 1764
>> gIsTTY = 1
>> gIsTTYr = 1
>> 
>> And from a cmd prompt:
>> isatty(2) = 1
>> isatty(0) = 1
>> getppid() = 1
>> gIsTTY = 0
>> gIsTTYr = 0
>> 
>> I'm not sure what the right fix is.  Options:
>>   1) Is this really a problem with the getppid implementation of cygwin
>> (?)
>>   2) patch ncftp to ignore the value of getppid() -- just use isatty(x)
>>      --> #ifdef __CYGWIN__, or for all platforms?  Why does ncftp test 
>>      getppid() anyway?  
>
>1) "No" from my point of view. A processes parent is set to PID 1 if
>   it's parent process isn't known by Cygwin - eg. is a native Windows
>   process. Windows is treated being `init'.
>
>2) That's the solution I would prefer. The check is senseless under
>   Cygwin.

Actually, I think it is pretty senseless in general.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019