You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/06 21:54:48 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6370: libc:Optimize the behavior of fwrite

pkarashchenko commented on code in PR #6370:
URL: https://github.com/apache/incubator-nuttx/pull/6370#discussion_r890594906


##########
libs/libc/stdio/lib_libfwrite.c:
##########
@@ -145,6 +133,25 @@ ssize_t lib_fwrite(FAR const void *ptr, size_t count, FAR FILE *stream)
         }
     }
 
+  if (count >= CONFIG_STDIO_BUFFER_SIZE)
+    {
+      ret = _NX_WRITE(stream->fs_fd, src, count);
+      if (ret < 0)
+        {
+          _NX_SETERRNO(ret);
+          ret = ERROR;
+          goto errout_with_semaphore;
+        }
+
+      src += ret;
+    }
+  else if (count)

Review Comment:
   minor
   ```suggestion
     else if (count > 0)
   ```



-- 
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