michallenc commented on code in PR #10602:
URL: https://github.com/apache/nuttx/pull/10602#discussion_r1361824618


##########
libs/libc/stdio/lib_fclose.c:
##########
@@ -115,32 +115,18 @@ int fclose(FAR FILE *stream)
 
       nxmutex_unlock(&slist->sl_lock);
 
-      /* Check that the underlying file descriptor corresponds to an an open
-       * file.
-       */
-
-      if (stream->fs_fd >= 0)
-        {
-          /* Close the file descriptor and save the return status */
+      /* Close the file descriptor and save the return status */
 
-#ifdef CONFIG_FDSAN
-          uint64_t tag;
-          tag = android_fdsan_create_owner_tag(ANDROID_FDSAN_OWNER_TYPE_FILE,
-                                               (uintptr_t)stream);
-          status = android_fdsan_close_with_tag(stream->fs_fd, tag);
-#else
-          status = close(stream->fs_fd);
-#endif
+      status = stream->fs_iofunc.close(stream->fs_cookie);

Review Comment:
   Added NULL check. Fopencookie actually allows the user to have close == NULL.



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to