From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: A question on wait_reading_process_output Date: Thu, 29 May 2008 10:57:00 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212073516 21907 80.91.229.12 (29 May 2008 15:05:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 May 2008 15:05:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Herbert Euler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 29 17:05:53 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 1K1jZv-0004H8-H6 for ged-emacs-devel@m.gmane.org; Thu, 29 May 2008 16:58:07 +0200 Original-Received: from localhost ([127.0.0.1]:43079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1jZA-00021Y-3N for ged-emacs-devel@m.gmane.org; Thu, 29 May 2008 10:57:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1jZ5-00021J-Af for emacs-devel@gnu.org; Thu, 29 May 2008 10:57:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1jZ3-000217-0b for emacs-devel@gnu.org; Thu, 29 May 2008 10:57:14 -0400 Original-Received: from [199.232.76.173] (port=36936 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1jZ2-000213-Ok for emacs-devel@gnu.org; Thu, 29 May 2008 10:57:12 -0400 Original-Received: from 206-248-174-248.dsl.teksavvy.com ([206.248.174.248]:44288 helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K1jZ2-0005aa-5X for emacs-devel@gnu.org; Thu, 29 May 2008 10:57:12 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 93C3EB41E2; Thu, 29 May 2008 10:57:00 -0400 (EDT) In-Reply-To: (Herbert Euler's message of "Wed, 28 May 2008 11:39:44 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:97976 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? I guess that'd make sense. Does anybody see a problem with it? Stefan --- process.c.~1.542.~ 2008-05-22 17:12:27.000000000 -0400 +++ process.c 2008-05-29 10:55:25.000000000 -0400 @@ -4475,7 +4479,10 @@ break; if (0 < nread) + { total_nread += nread; + got_some_input = 1; + } #ifdef EIO else if (nread == -1 && EIO == errno) break;