From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: some accept-process-output races fixed; Tramp FIXMEs Date: Wed, 16 Jan 2019 14:07:12 -0500 Message-ID: References: <46ce72ef-c4cb-1cd1-566a-c305ca92e68c@cs.ucla.edu> <80d86b5a-efb7-87cc-a3db-0a6ad356274d@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1547665642 21944 195.159.176.226 (16 Jan 2019 19:07:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2019 19:07:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 16 20:07:18 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjqWz-0005as-Oh for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2019 20:07:17 +0100 Original-Received: from localhost ([127.0.0.1]:53228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjqZ6-0007Hw-VZ for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2019 14:09:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjqXM-0006kT-0E for emacs-devel@gnu.org; Wed, 16 Jan 2019 14:07:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjqXK-0003JL-3P for emacs-devel@gnu.org; Wed, 16 Jan 2019 14:07:39 -0500 Original-Received: from [195.159.176.226] (port=45017 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjqXJ-00038e-Rq for emacs-devel@gnu.org; Wed, 16 Jan 2019 14:07:38 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gjqUt-0002ZA-FD for emacs-devel@gnu.org; Wed, 16 Jan 2019 20:05:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:/wNnGNThQ6fvrjDEn9/hVeeNhl0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232404 Archived-At: >> So how can the code tell when it has read all the data? > The code keeps calling accept-process-output until it gets nil. You mean without a timeout, right? With a timeout a value of nil doesn't guarantee you've had all the data (if the process is still live). I think we should make sure that (if (not (process-live-p p)) (progn (accept-process-output p) ;; Here we should be sure that we processed all the output whereas IIUC currently we need (if (not (process-live-p p)) (progn (while (accept-process-output p)) ;; Here we are presumably sure that we processed all the output Right? Stefan