fs/fcntl: add O_APPEND flag judge in fcntl
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
parent
bb1e81eb95
commit
05cc6fb610
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user