ncftp - works, but doesn't display any prompts
Corinna Vinschen
cygwin@cygwin.com
Thu Jan 25 07:09:00 GMT 2001
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.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin@cygwin.com
Red Hat, Inc.
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list