vfs: fdopen: add missing file stream flags clearing. Clear file stream structure regardless of config options. Structure clearing is needed as previous use of stream list entry might leave fs_flags set.
This commit is contained in:
parent
830ad9370a
commit
b8b9309d2b
@ -221,11 +221,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
|
|||||||
{
|
{
|
||||||
/* Zero the structure */
|
/* Zero the structure */
|
||||||
|
|
||||||
#ifndef CONFIG_STDIO_DISABLE_BUFFERING
|
|
||||||
memset(stream, 0, sizeof(FILE));
|
memset(stream, 0, sizeof(FILE));
|
||||||
#elif CONFIG_NUNGET_CHARS > 0
|
|
||||||
stream->fs_nungotten = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CONFIG_STDIO_DISABLE_BUFFERING
|
#ifndef CONFIG_STDIO_DISABLE_BUFFERING
|
||||||
/* Initialize the semaphore the manages access to the buffer */
|
/* Initialize the semaphore the manages access to the buffer */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user