public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Patrick Doyle <wpd@delcomsys.com>
To: ehud@unix.simonwiesel.co.il
Cc: cygwin@cygwin.com
Subject: Re: Why does scp leave ssh running? -- select() never returns
Date: Mon, 08 Jan 2001 06:24:00 -0000	[thread overview]
Message-ID: <3A59CDDD.A1A90194@delcomsys.com> (raw)
In-Reply-To: <200101081121.NAA25063@linux.>

Ehud Karni wrote:
> 
> On Sat, 06 Jan 2001 22:22:24 -0500, Patrick Doyle <wpd@delcomsys.com> wrote:
> >
> > I have been working on a hack workaround for this problem.  (Short
> > summary -- select() fails to detect when all of the writers of a pipe
> > have closed the pipe because PeekNamedPipe() on W9x boxen fails to
> > report when all of the writers of a pipe have closed the pipe.  I am
> > told that this all works correctly on NT/2K boxen).
> 
> My work around for Win95/98 is a bash script, executed directly from
> the windows command (I associated sh with /bin/bash):
> 
Thanks for the excellent script.  It looks like it solves the specific
problem that I was complaining about (namely that scp leaves an ssh
running), but unfortunately it doesn't solve other related problems that
share the same root cause.  For example, using SSH with CVS appears to
hang at the end of the CVS operation.  (CVS is waiting for SSH to
complete.  SSH is waiting to detect an EOF on its input pipe).  I am
hoping to solve this problem in the cygwil DLL, so that it is solved
once, rather than for each application that encounters it.

> > Basically, I have modified 'pipe()' to create two windows pipes (on W9x
> > boxen).  The first pipe is the same one that has always been created.
> > [ snip ]
> 
> Well, it seems a very complicated work around for the W9x bug. I would
> have taken a much simpler and direct approach like this:
>    1) Save the child (ssh) process id in a global variable,
>            (i.e. child=fork() ;)
>    2) Just before exiting, send kill signal to the child with no
>      checks,  (i.e. kill(child, SIGTERM) ;)
> 
> This might look like brute force, but it works. It has the advantage
> that it works with ssh unmodified and with any other program that may
> be given as argument to scp.
> 
I think that you are saying that your approach would have been to modify
scp (and later cvs) to work around this problem.  Again, I would rather
fix it in the library, and not have to modify each application that runs
into this.  I admit, my solution is complicated, it is a hack, in the
end I may never be able to make it work right, etc..., but, so far, it
is the only viable approach that I have been able to envision.  Every
other approach I have thought of runs into the problem that it depends
on capabilities that are in NT/2K, but not W9x.  Sigh...  I really
appreciate Christoper's statement that he hates Window 9x programming.

--wpd

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

  reply	other threads:[~2001-01-08  6:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-27 12:26 Why does scp leave ssh running? Patrick Doyle
2000-11-28  2:12 ` Graham Bloice
2000-11-29 19:21 ` Why does scp leave ssh running? -- select() never returns Patrick Doyle
2000-11-29 19:41   ` Christopher Faylor
2000-11-30  6:15     ` Patrick Doyle
2000-11-30  6:35       ` Corinna Vinschen
2000-11-30  7:05         ` Patrick Doyle
2000-11-30 19:40       ` Patrick Doyle
2000-12-02 17:08         ` Christopher Faylor
2000-12-02 19:47           ` Patrick Doyle
2000-12-02 20:39             ` Christopher Faylor
2000-12-03  1:47               ` Corinna Vinschen
2000-12-11 10:19                 ` Patrick Doyle
2000-12-11 10:36                   ` Christopher Faylor
2000-12-11 10:56                     ` Patrick Doyle
2000-12-11 11:08                       ` Christopher Faylor
2001-01-06 19:21                       ` Patrick Doyle
2001-01-08  3:21                         ` Ehud Karni
2001-01-08  6:24                           ` Patrick Doyle [this message]
2000-12-12  5:46                   ` David Starks-Browning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A59CDDD.A1A90194@delcomsys.com \
    --to=wpd@delcomsys.com \
    --cc=cygwin@cygwin.com \
    --cc=ehud@unix.simonwiesel.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).