lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5 08/20] rtla: Helper functions for rtla
On Wed, 27 Oct 2021 00:22:04 +0800
Tao Zhou <tao.zhou@linux.dev> wrote:

> > + do {
> > + retval = read(in_fd, buffer, sizeof(buffer));
> > + if (read <= 0)
>
> check "retval" not read. Like:
>
> if (retval <= 0)

OUCH! Good check.

Daniel, did that not produce any warnings??

-- Steve


>
> > + goto out_close;
> > +
> > + retval = write(out_fd, buffer, retval);
> > + if (retval < 0)
> > + goto out_close;
> > + } while (retval > 0);

\
 
 \ /
  Last update: 2021-10-26 18:27    [W:0.047 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site