This is the mail archive of the
mailing list for the binutils project.
Re: [Bug-readline] [PATCH] readline/histfile.c: Check and retry write() operation in history_truncate_file()
- From: Chen Gang <gang dot chen dot 5i5j at gmail dot com>
- To: chet dot ramey at case dot edu
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, palves at redhat dot com, gdb-patches at sourceware dot org, binutils at sourceware dot org, bug-readline at gnu dot org, amodra at gmail dot com
- Date: Thu, 26 Jun 2014 06:16:32 +0800
- Subject: Re: [Bug-readline] [PATCH] readline/histfile.c: Check and retry write() operation in history_truncate_file()
- Authentication-results: sourceware.org; auth=none
- References: <5397C077 dot 1080702 at gmail dot com> <53A1F78A dot 8020508 at case dot edu> <53A23D77 dot 1040905 at gmail dot com> <53A3F78E dot 6020803 at gmail dot com> <53A4AD62 dot 6020408 at case dot edu> <53A4ED1B dot 2060608 at gmail dot com> <53A612EF dot 9070400 at case dot edu> <53A638EF dot 6050700 at gmail dot com> <53A8322D dot 3010703 at case dot edu> <53A840CD dot 1050205 at gmail dot com>
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.
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).
>>> "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.
Open share and attitude like air water and life which God blessed