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:
Harri Luhtala 2017-05-31 06:20:18 -06:00 committed by Gregory Nutt
parent 830ad9370a
commit b8b9309d2b

View File

@ -221,11 +221,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
{
/* Zero the structure */
#ifndef CONFIG_STDIO_DISABLE_BUFFERING
memset(stream, 0, sizeof(FILE));
#elif CONFIG_NUNGET_CHARS > 0
stream->fs_nungotten = 0;
#endif
#ifndef CONFIG_STDIO_DISABLE_BUFFERING
/* Initialize the semaphore the manages access to the buffer */