From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: "^D^H^H" in process output on Darwin Date: Sat, 17 Sep 2005 10:33:19 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <8664t5fkeh.fsf@panel.jk.homeunix.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1126920997 12449 80.91.229.2 (17 Sep 2005 01:36:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2005 01:36:37 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 17 03:36:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EGRc4-0004dC-SP for ged-emacs-devel@m.gmane.org; Sat, 17 Sep 2005 03:35:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EGRc4-0007zY-5u for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2005 21:35:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EGRbu-0007yM-Sj for emacs-devel@gnu.org; Fri, 16 Sep 2005 21:35:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EGRbt-0007xE-IC for emacs-devel@gnu.org; Fri, 16 Sep 2005 21:35:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EGRbt-0007x7-EI for emacs-devel@gnu.org; Fri, 16 Sep 2005 21:35:21 -0400 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EGRZw-0007F4-Es for emacs-devel@gnu.org; Fri, 16 Sep 2005 21:33:20 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 154B62CD3; Sat, 17 Sep 2005 10:33:19 +0900 (JST) Original-To: Nozomu Ando In-Reply-To: <8664t5fkeh.fsf@panel.jk.homeunix.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43024 Archived-At: >>>>> On Tue, 13 Sep 2005 17:21:10 +0900, Nozomu Ando said: >> (It actually hangs on Mac OS X 10.1.5 and 10.2.8 if >> process-connection-type is set to t. On Mac OS X 10.3.9 it seems >> not to hang. Are there any other problems with vfork on Mac OS X >> 10.3, which is based on Darwin 7?) > A restriction of setsid(2) after vfork(2) may affect Emacs. > http://homepage.mac.com/nand/macosx/vfork_setsid.html Thanks for the info. I'm not sure if it is a real issue for Emacs or not, but maybe vfork should be avoided for now just to be on the safe side. I think I'll move the child_setup_tty call to before (v)fork only for the case that the tty is not reopened in the child process. Any ideas/objections? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp Index: src/process.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/process.c,v retrieving revision 1.463 diff -c -r1.463 process.c *** src/process.c 15 Aug 2005 08:44:53 -0000 1.463 --- src/process.c 17 Sep 2005 01:19:14 -0000 *************** *** 1793,1798 **** --- 1793,1804 ---- #endif if (forkin < 0) report_file_error ("Opening pty", Qnil); + #if defined (RTU) || defined (UNIPLUS) || defined (DONT_REOPEN_PTY) + /* In the case that vfork is defined as fork, the parent process + (Emacs) may send some data before the child process completes + tty options setup. So we setup tty before forking. */ + child_setup_tty (forkout); + #endif /* RTU or UNIPLUS or DONT_REOPEN_PTY */ #else forkin = forkout = -1; #endif /* not USG, or USG_SUBTTY_WORKS */ *************** *** 2077,2084 **** --- 2083,2092 ---- #endif /* SIGCHLD */ #endif /* !POSIX_SIGNALS */ + #if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) if (pty_flag) child_setup_tty (xforkout); + #endif /* not RTU and not UNIPLUS and not DONT_REOPEN_PTY */ #ifdef WINDOWSNT pid = child_setup (xforkin, xforkout, xforkout, new_argv, 1, current_dir);