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: RE: A question on wait_reading_process_output Date: Fri, 30 May 2008 09:27:55 +0800 Message-ID: References: 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 1212110897 22689 80.91.229.12 (30 May 2008 01:28:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 May 2008 01:28:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 30 03:28:58 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 1K1tQI-0006of-Vx for ged-emacs-devel@m.gmane.org; Fri, 30 May 2008 03:28:51 +0200 Original-Received: from localhost ([127.0.0.1]:45658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1tPX-0005eT-7t for ged-emacs-devel@m.gmane.org; Thu, 29 May 2008 21:28:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1tPU-0005eF-1C for emacs-devel@gnu.org; Thu, 29 May 2008 21:28:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1tPR-0005e1-Jt for emacs-devel@gnu.org; Thu, 29 May 2008 21:27:58 -0400 Original-Received: from [199.232.76.173] (port=37246 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1tPR-0005dy-DR for emacs-devel@gnu.org; Thu, 29 May 2008 21:27:57 -0400 Original-Received: from bay0-omc3-s11.bay0.hotmail.com ([65.54.246.211]:57489) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K1tPR-00080G-0T for emacs-devel@gnu.org; Thu, 29 May 2008 21:27:57 -0400 Original-Received: from BAY143-W45 ([65.55.154.80]) by bay0-omc3-s11.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 29 May 2008 18:27:56 -0700 X-Originating-IP: [216.145.54.158] Importance: Normal In-Reply-To: X-OriginalArrivalTime: 30 May 2008 01:27:56.0064 (UTC) FILETIME=[6334BA00:01C8C1F4] 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:98029 Archived-At: >> 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. > > So you're proposing a patch like the onw below? Based on the fact I see, yes. In fact I prefer changing got_some_input outside the inner reading loop, like this: Regards, Guanpeng Xu Index: process.c =================================================================== RCS file: /sources/emacs/emacs/src/process.c,v retrieving revision 1.542 diff -c -F '^[_a-zA-Z0-9$]+ *(' -r1.542 process.c *** process.c 22 May 2008 14:53:26 -0000 1.542 --- process.c 30 May 2008 01:24:24 -0000 *************** wait_reading_process_output (time_limit, *** 4489,4494 **** --- 4489,4495 ---- break; #endif } + got_some_input = total_nread> 0 ? 1 : 0; if (total_nread> 0 && do_display) redisplay_preserve_echo_area (10); _________________________________________________________________ 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