xiaoxiang781216 commented on a change in pull request #5519:
URL: https://github.com/apache/incubator-nuttx/pull/5519#discussion_r810265977
##########
File path: libs/libc/stdio/lib_vfprintf.c
##########
@@ -37,23 +37,20 @@ int vfprintf(FAR FILE *stream, FAR const IPTR char *fmt,
va_list ap)
struct lib_stdoutstream_s stdoutstream;
int n = ERROR;
- if (stream)
- {
- /* Wrap the stream in a stream object and let lib_vsprintf
- * do the work.
- */
-
- lib_stdoutstream(&stdoutstream, stream);
-
- /* Hold the stream semaphore throughout the lib_vsprintf
- * call so that this thread can get its entire message out
- * before being pre-empted by the next thread.
- */
-
- lib_take_semaphore(stream);
- n = lib_vsprintf(&stdoutstream.public, fmt, ap);
- lib_give_semaphore(stream);
- }
+ /* Wrap the stream in a stream object and let lib_vsprintf
+ * do the work.
+ */
+
+ lib_stdoutstream(&stdoutstream, stream);
+
+ /* Hold the stream semaphore throughout the lib_vsprintf
+ * call so that this thread can get its entire message out
+ * before being pre-empted by the next thread.
+ */
+
+ lib_take_semaphore(stream);
+ n = lib_vsprintf(&stdoutstream.public, fmt, ap);
Review comment:
Ok, let's do in the next patch.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]