fs/fcntl: add O_APPEND flag judge in fcntl

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao 2021-12-31 17:48:00 +08:00 committed by Petro Karashchenko
parent bb1e81eb95
commit 05cc6fb610

View File

@ -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;