This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 05cc6fb610de679d78079f38037e131103ca2db8 Author: liuhaitao <liuhai...@xiaomi.com> AuthorDate: Fri Dec 31 17:48:00 2021 +0800 fs/fcntl: add O_APPEND flag judge in fcntl Signed-off-by: liuhaitao <liuhai...@xiaomi.com> --- fs/vfs/fs_fcntl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/vfs/fs_fcntl.c b/fs/vfs/fs_fcntl.c index 1f6f425eed..f796fa5b23 100644 --- a/fs/vfs/fs_fcntl.c +++ b/fs/vfs/fs_fcntl.c @@ -150,6 +150,11 @@ static int file_vfcntl(FAR struct file *filep, int cmd, va_list ap) oflags &= (FFCNTL & ~O_NONBLOCK); filep->f_oflags &= ~(FFCNTL & ~O_NONBLOCK); filep->f_oflags |= oflags; + + if (filep->f_oflags & O_APPEND) + { + file_seek(filep, 0, SEEK_END); + } } } break;