From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22221 invoked by alias); 23 Jun 2014 14:59:40 -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 22199 invoked by uid 89); 23 Jun 2014 14:59:39 -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-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 23 Jun 2014 14:59:38 +0000 Received: by mail-pa0-f43.google.com with SMTP id lf10so5976365pab.16 for ; Mon, 23 Jun 2014 07:59:36 -0700 (PDT) X-Received: by 10.68.213.97 with SMTP id nr1mr29209798pbc.52.1403535576494; Mon, 23 Jun 2014 07:59:36 -0700 (PDT) Received: from [192.168.1.102] ([223.72.65.105]) by mx.google.com with ESMTPSA id ak1sm27331986pbc.58.2014.06.23.07.59.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 07:59:35 -0700 (PDT) Message-ID: <53A840CD.1050205@gmail.com> Date: Mon, 23 Jun 2014 14:59: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> In-Reply-To: <53A8322D.3010703@case.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-06/txt/msg00818.txt.bz2 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. -- Open share and attitude like air warter and life which God blessed