[PATCH] Fix umove/umoven return value
Ben Noordhuis
info at bnoordhuis.nl
Tue Feb 26 03:07:03 UTC 2013
On Tue, Feb 26, 2013 at 3:45 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
>> diff --git a/util.c b/util.c
>> index 405670e..af73f09 100644
>> --- a/util.c
>> +++ b/util.c
>> @@ -800,6 +800,8 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr)
>> remote, 1,
>> /*flags:*/ 0
>> );
>> + if (r == len)
>> + return 0;
>
> This should rather be (r >= 0), and errno != ENOSYS shouldn't fall back to
> vm_readv_didnt_work case.
r >= 0 seems less safe than r == len. What if you get less bytes than expected?
The errno != ENOSYS flow is unchanged, it was already like that.
More information about the Strace-devel
mailing list