From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Herbert Euler Newsgroups: gmane.emacs.devel Subject: A question on wait_reading_process_output Date: Wed, 28 May 2008 11:39:44 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1211946001 6566 80.91.229.12 (28 May 2008 03:40:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 May 2008 03:40:01 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 28 05:40:41 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K1CWm-0005js-Sa for ged-emacs-devel@m.gmane.org; Wed, 28 May 2008 05:40:41 +0200 Original-Received: from localhost ([127.0.0.1]:44490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1CW1-0005lv-JA for ged-emacs-devel@m.gmane.org; Tue, 27 May 2008 23:39:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1CVx-0005lq-9K for emacs-devel@gnu.org; Tue, 27 May 2008 23:39:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1CVu-0005le-Qf for emacs-devel@gnu.org; Tue, 27 May 2008 23:39:48 -0400 Original-Received: from [199.232.76.173] (port=38074 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1CVu-0005lX-NH for emacs-devel@gnu.org; Tue, 27 May 2008 23:39:46 -0400 Original-Received: from bay0-omc2-s33.bay0.hotmail.com ([65.54.246.169]:47870) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K1CVu-0008OA-C3 for emacs-devel@gnu.org; Tue, 27 May 2008 23:39:46 -0400 Original-Received: from BAY143-W10 ([65.55.154.45]) by bay0-omc2-s33.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 27 May 2008 20:39:44 -0700 X-Originating-IP: [216.145.54.7] Importance: Normal X-OriginalArrivalTime: 28 May 2008 03:39:44.0924 (UTC) FILETIME=[786D7DC0:01C8C074] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ 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:97866 Archived-At: I have a question on this function, more precisely, line 4460 through 4496 in process.c. The following predicates shows how that code would be entered: if (wait_proc && ! EQ (wait_proc->status, Qrun) && ! EQ (wait_proc->status, Qconnect)) That is, when wait_proc is not running anymore. The output from wait_proc is read in the body of the if, and after that, the last statement, break, causes the execution quiting from the outmost loop. The value of got_some_input becomes the value of the calling to wait_reading_process_output after the quiting. There seems a problem here: The value of got_some_input isn't set to nonzero during the reading happens inside the body of the if even when something has been read, so it is possible that something has been read from wait_proc's output but got_some_input is still zero. In that case, the return value of wait_reading_process is not what it promises. It's hard to produce such a case to reveal this case, so it remains my guess. Perhaps I missed something, but is my guess right? Thanks in advance. Regards, Guanpeng Xu _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us