From nobody@FreeBSD.org  Tue Oct  7 19:48:18 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 053931065689
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Oct 2008 19:48:18 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id CEA1B8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Oct 2008 19:48:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m97JmHZr070362
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 7 Oct 2008 19:48:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id m97JmH9x070361;
	Tue, 7 Oct 2008 19:48:17 GMT
	(envelope-from nobody)
Message-Id: <200810071948.m97JmH9x070361@www.freebsd.org>
Date: Tue, 7 Oct 2008 19:48:17 GMT
From: Eugen Konkov <kes@kes.net.ua>
To: freebsd-gnats-submit@FreeBSD.org
Subject: auto-logout does not work
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127930
>Category:       kern
>Synopsis:       auto-logout does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ed
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 07 19:50:00 UTC 2008
>Closed-Date:    
>Last-Modified:  Wed Apr  8 14:10:04 UTC 2009
>Originator:     Eugen Konkov
>Release:        8.0-CURRENT-200809
>Organization:
ISP Konkov
>Environment:
home# uname -a
FreeBSD home.kes.net.ua 8.0-CURRENT-200809 FreeBSD 8.0-CURRENT-200809 #0: Sun Sep  7 22:13:46 UTC 2008     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
1. I run "mc" (/usr/ports/misc/mc)
2. CTRL+O
3. after some time I get next:

home# auto-logout
read (subshell_pty...): Interrupted system call (4)
home#

4. Actually system close mc but does not logout me

>How-To-Repeat:

>Fix:
close all subshells

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ed 
Responsible-Changed-By: remko 
Responsible-Changed-When: Tue Oct 7 19:53:09 UTC 2008 
Responsible-Changed-Why:  
Ed can you help with this one please? Might be TTY related (As the 
message in the ticket suggests, could also be that MC is blocking the 
logout somehow) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127930 

From: Edwin Groothuis <edwin@mavetju.org>
To: Eugen Konkov <kes@kes.net.ua>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/127930: auto-logout does not work
Date: Wed, 8 Oct 2008 23:15:07 +1100

 On Tue, Oct 07, 2008 at 07:48:17PM +0000, Eugen Konkov wrote:
 > home# auto-logout
 > read (subshell_pty...): Interrupted system call (4)
 
 When I run midc + ^O and enter "exit" in the "command line" I get
 the same kind of message:
 
 [~] edwin@k7>exit
 exit
 read (subshell_pty...): Interrupted system call (4)
 [~] edwin@k7>
 
 The first prompt is inside the midc ^O window, the second prompt is
 from before the midc command. The string "read (subshell_pty...)"
 is part of the misc/mc source code.
 
 
 Most likely it will auto-logout later when it kills the original
 shell too.
 
 Edwin
 -- 
 Edwin Groothuis		Website: http://www.mavetju.org/
 edwin@mavetju.org	Weblog:  http://www.mavetju.org/weblog/

From: Ed Schouten <ed@80386.nl>
To: bug-followup@FreeBSD.org, kes@kes.net.ua
Cc:  
Subject: Re: kern/127930: auto-logout does not work
Date: Wed, 8 Apr 2009 16:00:43 +0200

 --APlYHCtpeOhspHkB
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Hi all,
 
 Sorry for taking so long to actually investigate this issue. I'm not
 sure what to do with this PR, but this is not a bug in the TTY layer,
 but in mc.
 
 It turns out mc uses a certain Linux-ism. Consider the following
 application:
 
 	http://80386.nl/pub/pty-error.c
 
 It behaves differently on certain operating systems:
 
 - FreeBSD:	returns 0
 - Mac OS X:	returns 0
 - Solaris:	returns 0
 - Linux:	returns -1, errno =3D=3D EIO
 
 Right now the subshell only works on Linux.
 
 --=20
  Ed Schouten <ed@80386.nl>
  WWW: http://80386.nl/
 
 --APlYHCtpeOhspHkB
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (FreeBSD)
 
 iEYEARECAAYFAkncrgsACgkQ52SDGA2eCwWxpACfSgmoN3rUTYrKS09nqqSxP9ZZ
 m7UAnjnlVloIsloo8IKgoMzLTNPw/8Q/
 =YJ03
 -----END PGP SIGNATURE-----
 
 --APlYHCtpeOhspHkB--
>Unformatted:
