vfs: fdopen: add missing file stream flags clearing.
authorEunBong Song <eunb.song@samsung.com>
Tue, 4 Jul 2017 06:01:34 +0000 (15:01 +0900)
committerEunBong Song <eunb.song@samsung.com>
Wed, 30 Aug 2017 04:15:43 +0000 (21:15 -0700)
Clear file stream structure regardless of config options.
Structure clearing is needed as previous use of stream
list entry might leave fs_flags set.
Thia patch comes from nuttx community commit id: b8b9309d

Change-Id: I072757f092cedc179982af736d6d9a48ee90c97b
Signed-off-by: EunBong Song <eunb.song@samsung.com>
os/fs/vfs/fs_fdopen.c

index 4e4b34f..a4a8a1f 100644 (file)
@@ -228,11 +228,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
                if (stream->fs_fd < 0) {
                        /* Zero the structure */
 
-#if CONFIG_STDIO_BUFFER_SIZE > 0
                        memset(stream, 0, sizeof(FILE));
-#elif CONFIG_NUNGET_CHARS > 0
-                       stream->fs_nungotten = 0;
-#endif
 
 #if CONFIG_STDIO_BUFFER_SIZE > 0
                        /* Initialize the semaphore the manages access to the buffer */