From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: [angeloff@acm.org: Emacs bug with Solaris 9 (only)] Date: Mon, 17 Feb 2003 15:38:14 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1045514258 1207 80.91.224.249 (17 Feb 2003 20:37:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 17 Feb 2003 20:37:38 +0000 (UTC) Cc: angeloff@acm.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ks1A-0000JI-00 for ; Mon, 17 Feb 2003 21:37:36 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18ksFj-0005OH-00 for ; Mon, 17 Feb 2003 21:52:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ks2f-000473-04 for emacs-devel@quimby.gnus.org; Mon, 17 Feb 2003 15:39:09 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18ks29-00040J-00 for emacs-devel@gnu.org; Mon, 17 Feb 2003 15:38:37 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18ks27-0003yh-00 for emacs-devel@gnu.org; Mon, 17 Feb 2003 15:38:36 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ks1p-0003oG-00 for emacs-devel@gnu.org; Mon, 17 Feb 2003 15:38:17 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.10) id 18ks1m-0004m9-00; Mon, 17 Feb 2003 15:38:14 -0500 Original-To: "Jan D." In-reply-to: (jan.h.d@swipnet.se) Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11714 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11714 But later at the end of the same function (create_process) we have: /* vfork succeeded. */ ... XPROCESS (process)->subtty = Qnil; if (forkin >= 0) emacs_close (forkin); This code is really self-contradictory. I studied the code some more. The idea of subtty seems to be that it holds the terminal descriptor that the child should use. However, the code you cite above seems to assume that descriptor needs to be closed. That code seems to have been present since 1994. However, in version 1.1 of process.c it looked like this: #ifdef SYSV4_PTYS /* OK to close only if it's not a pty. Otherwise we need to leave it open for ioctl to get pgrp when signals are sent, or to send the interrupt characters through if that's how we're signalling subprocesses. Alternately if you are concerned about running out of file descriptors, you could just save the tty name and open just to do the ioctl. */ if (NILP (XFASTINT (XPROCESS (process)->pty_flag))) #endif { XPROCESS (process)->subtty = Qnil; if (forkin >= 0) close (forkin); } It looks like subtty is obsolete. We could delete it, unless there is some system on which really using it would solve some problem today.