Re: [PATCH V5 08/20] rtla: Helper functions for rtla

From
Steven Rostedt <rostedt@goodmis.org>
Date
2021-10-26 16:26:30
Also in
lkml
Reply to
Tao Zhou, 2021-10-26
On Wed, 27 Oct 2021 00:22:04 +0800
Tao Zhou [off-list ref] wrote:
quoted
+	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

quoted
+			goto out_close;
+
+		retval = write(out_fd, buffer, retval);
+		if (retval < 0)
+			goto out_close;
+	} while (retval > 0);
Thread (32 messages) 32 messages, 3 authors, last reply 2021-10-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help