michallenc commented on code in PR #10602: URL: https://github.com/apache/nuttx/pull/10602#discussion_r1360449576
########## libs/libc/stdio/lib_fclose.c: ########## @@ -115,32 +115,41 @@ int fclose(FAR FILE *stream) nxmutex_unlock(&slist->sl_lock); - /* Check that the underlying file descriptor corresponds to an an open - * file. - */ + /* Close the file descriptor and save the return status */ - if (stream->fs_fd >= 0) +#ifdef CONFIG_FDSAN + if (stream->fs_hascookie == 0) { - /* Close the file descriptor and save the return status */ + /* This is a little warkaround. Ideally we would want to call + * fs_iofunc.close and let that handle it. FDSAN however requires + * stream to create owner tag and this is not avalialble in Review Comment: Done -- 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