You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "acassis (via GitHub)" <gi...@apache.org> on 2023/06/21 00:20:34 UTC

[GitHub] [nuttx] acassis commented on a diff in pull request #9576: sendfile: Fixed behavior of sendfile when count is set to zero.

acassis commented on code in PR #9576:
URL: https://github.com/apache/nuttx/pull/9576#discussion_r1236026431


##########
fs/vfs/fs_sendfile.c:
##########
@@ -244,6 +244,11 @@ static ssize_t copyfile(FAR struct file *outfile, FAR struct file *infile,
 ssize_t file_sendfile(FAR struct file *outfile, FAR struct file *infile,
                       off_t *offset, size_t count)
 {
+  if (count == 0)
+    {
+      return 0;

Review Comment:
   please add a nwarn() to let the user know that is tried to send a packet with 0 bytes. I think that kind message could have helped you with your application! ;-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org