X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o- Date: Mon, 25 Jul 2011 11:04:55 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: SIGHUP on pty closure Message-ID: <20110725150455.GB1040@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4E289D7B DOT 4050103 AT gmail DOT com> <4E2D474A DOT 4000509 AT gmail DOT com> <20110725111445 DOT GB11462 AT calimero DOT vinschen DOT de> <4E2D5752 DOT 80204 AT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E2D5752.80204@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Mon, Jul 25, 2011 at 01:45:22PM +0200, Marco atzeri wrote: >On 7/25/2011 1:14 PM, Corinna Vinschen wrote: >> On Jul 25 12:36, Marco atzeri wrote: >>> It seems that mc is correct in the expectation. >>> >>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html >>> >>> "If fildes refers to the master side of a pseudo-terminal, and this >>> is the last close, a SIGHUP signal shall be sent to the controlling >>> process, if any, for which the slave side of the pseudo-terminal is >>> the controlling terminal. It is unspecified whether closing the >>> master side of the pseudo-terminal flushes all queued input and >>> output." >>> >>> >>> I don't find such implementation on cygwin >>> >>> fhandler_pty_master::close () >>> >>> Am I looking in the wrong place ? >> >> No, I don't think so. I'm not fluent with mc. How can I reproduce >> the issue? >> >> >> Corinna >> > > >$ mc -U (to run mc with subshell) > >pres CTRL-O (to swith on subshell) > >$ ps ax > PID PPID PGID WINPID TTY UID STIME COMMAND > 1112 1 1112 1112 ? 1006 13:42:30 /usr/bin/mintty > 556 1112 556 5860 3 1006 13:42:30 /usr/bin/bash > 5048 556 5048 2720 3 1006 13:43:00 /usr/bin/mc > 2820 5048 2820 2064 0 1006 13:43:00 /usr/bin/bash > 460 2820 460 5980 0 1006 13:43:04 /usr/bin/ps > > >press CTRL-O (to return on mc) > >F10 (to exit from mc) > >the subshell remains open > >$ ps ax > PID PPID PGID WINPID TTY UID STIME COMMAND > 1112 1 1112 1112 ? 1006 13:42:30 /usr/bin/mintty > 556 1112 556 5860 3 1006 13:42:30 /usr/bin/bash >I 2820 1 2820 2064 0 1006 13:43:00 /usr/bin/bash > 2968 556 2968 5096 3 1006 13:43:42 /usr/bin/ps > >sending the SIGHUP >$ kill -SIGHUP 2820 > >$ ps ax > PID PPID PGID WINPID TTY UID STIME COMMAND > 1112 1 1112 1112 ? 1006 13:42:30 /usr/bin/mintty > 556 1112 556 5860 3 1006 13:42:30 /usr/bin/bash > 5344 556 5344 4804 3 1006 13:44:06 /usr/bin/ps > >the subshell closes. Since I was the person who insisted that this "mc bug" be fixed, I'll take a look at fixing this unless Corinna has already beaten me to it. cgf -- 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