From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2236 invoked by alias); 22 Jun 2014 02:01:55 -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 31849 invoked by uid 89); 22 Jun 2014 02:01:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 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-pb0-f44.google.com Received: from mail-pb0-f44.google.com (HELO mail-pb0-f44.google.com) (209.85.160.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 22 Jun 2014 02:01:38 +0000 Received: by mail-pb0-f44.google.com with SMTP id md12so4461616pbc.31 for ; Sat, 21 Jun 2014 19:01:36 -0700 (PDT) X-Received: by 10.68.235.6 with SMTP id ui6mr17245712pbc.45.1403402496665; Sat, 21 Jun 2014 19:01:36 -0700 (PDT) Received: from [192.168.1.23] ([124.127.118.42]) by mx.google.com with ESMTPSA id by1sm20080061pbb.75.2014.06.21.19.01.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 19:01:36 -0700 (PDT) Message-ID: <53A638EF.6050700@gmail.com> Date: Sun, 22 Jun 2014 02:01:00 -0000 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 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> In-Reply-To: <53A612EF.9070400@case.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-06/txt/msg00793.txt.bz2 On 06/22/2014 07:19 AM, Chet Ramey wrote: > On 6/20/14, 10:25 PM, Chen Gang wrote: > >>> There aren't really any plausible conditions under which write(2) returns >>> 0 instead of -1 when writing a non-zero number of bytes to a regular file. >>> >> >> Hmm... for me, what you said is acceptable. And the function comment need be >> changed: >> >> "Returns 0 on success, errno or -1 on failure" > > history_truncate_file will never return -1. > Hmm... do you mean: "for regular file, write() never return 0, if parameter 'count' > 0?" or "if write() return 0, can also return 0 to history_truncate_file()?". >> And since you will work for it next, is it still necessary to send patch v2 for >> the temporary fix, at present? > > I will take care of making those changes, thanks. OK, thanks (I need/shall not send patch v2 for it). Thanks. -- Chen Gang Open, share, and attitude like air, water, and life which God blessed