delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/07/25/07:45:50

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4E2D5752.80204@gmail.com>
Date: Mon, 25 Jul 2011 13:45:22 +0200
From: Marco atzeri <marco DOT atzeri AT gmail DOT com>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: SIGHUP on pty closure
References: <4E289D7B DOT 4050103 AT gmail DOT com> <4E2D474A DOT 4000509 AT gmail DOT com> <20110725111445 DOT GB11462 AT calimero DOT vinschen DOT de>
In-Reply-To: <20110725111445.GB11462@calimero.vinschen.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 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.

Regards
Marco

--
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

- Raw text -


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