From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5945 invoked by alias); 25 Jun 2014 22:16:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5920 invoked by uid 89); 25 Jun 2014 22:16:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 25 Jun 2014 22:16:34 +0000 Received: by mail-pa0-f47.google.com with SMTP id kq14so2267014pab.34 for ; Wed, 25 Jun 2014 15:16:32 -0700 (PDT) X-Received: by 10.66.142.73 with SMTP id ru9mr15460352pab.41.1403734592659; Wed, 25 Jun 2014 15:16:32 -0700 (PDT) Received: from [192.168.1.100] ([223.72.65.93]) by mx.google.com with ESMTPSA id z3sm24215750pas.15.2014.06.25.15.16.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 25 Jun 2014 15:16:32 -0700 (PDT) Message-ID: <53AB4A40.7070009@gmail.com> Date: Wed, 25 Jun 2014 22:16:00 -0000 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: chet.ramey@case.edu CC: Andreas Schwab , palves@redhat.com, gdb-patches@sourceware.org, binutils@sourceware.org, bug-readline@gnu.org, amodra@gmail.com Subject: Re: [Bug-readline] [PATCH] readline/histfile.c: Check and retry write() operation in history_truncate_file() References: <5397C077.1080702@gmail.com> <53A1F78A.8020508@case.edu> <53A23D77.1040905@gmail.com> <53A3F78E.6020803@gmail.com> <53A4AD62.6020408@case.edu> <53A4ED1B.2060608@gmail.com> <53A612EF.9070400@case.edu> <53A638EF.6050700@gmail.com> <53A8322D.3010703@case.edu> <53A840CD.1050205@gmail.com> In-Reply-To: <53A840CD.1050205@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-06/txt/msg00896.txt.bz2 And I guess, we can simply bypass this discussion, because the new fix can process write() well and let history_truncate_file() never return -1. Thanks. On 06/23/2014 10:59 PM, Chen Gang wrote: > On 06/23/2014 09:57 PM, Chet Ramey wrote: >> On 6/21/14, 10:01 PM, Chen Gang wrote: >> >>>> history_truncate_file will never return -1. >>>> >>> >>> Hmm... do you mean: >>> >>> "for regular file, write() never return 0, if parameter 'count' > 0?" >>> > > I am not quite sure whether it is true, in my experience, it should be > true, but I have no any proofs for it (if you have, welcome to supply). > > thank. > >>> or >>> >>> "if write() return 0, can also return 0 to history_truncate_file()?". >> > > For me, if write() could return 0, when it happened, we had to process the > case within history_truncate_file(), could not only return 0 to indicate > all things go on well. > > >> Both of those things are true, but neither is what I said above. >> > > If both of those things are not true, what your originally said above > are not true, either. > > > Thanks. > -- Chen Gang Open share and attitude like air water and life which God blessed