SIGHUP on pty closure

Marco atzeri marco.atzeri@gmail.com
Mon Jul 25 11:45:00 GMT 2011


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



More information about the Cygwin mailing list