Re: [PATCH v4 12/16] perf header: add a buffer to struct feat_fd

From: David Carrillo-Cisneros
Date: Tue Jun 13 2017 - 21:54:21 EST


On Tue, Jun 13, 2017 at 11:54 AM, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> On Mon, Jun 12, 2017 at 09:29:28PM -0700, David Carrillo-Cisneros wrote:
>
> SNIP
>
>> /* Return: 0 if succeded, -ERR if failed. */
>> int write_padded(struct feat_fd *ff, const void *bf,
>> size_t count, size_t count_aligned)
>> @@ -125,13 +151,32 @@ static int do_write_string(struct feat_fd *ff, const char *str)
>> return write_padded(ff, str, olen, len);
>> }
>>
>> -static int __do_read(struct feat_fd *ff, void *addr, ssize_t size)
>> +static int __do_read_fd(struct feat_fd *ff, void *addr, ssize_t size)
>> {
>> - ssize_t ret = readn(ff->fd, addr, size);
>> + ssize_t ret = readn(ff->fd, addr, size);
>> +
>> + if (ret != size)
>> + return ret < 0 ? (int)ret : -1;
>> + return 0;
>
> extra tab in indent

fixed