fs: remove un-useful memcpy() in nx_close_from_tcb()
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
e1cd082c29
commit
9f51c47c10
@ -712,7 +712,6 @@ int dup3(int fd1, int fd2, int flags)
|
||||
int nx_close_from_tcb(FAR struct tcb_s *tcb, int fd)
|
||||
{
|
||||
FAR struct file *filep;
|
||||
FAR struct file file;
|
||||
FAR struct filelist *list;
|
||||
|
||||
#ifdef CONFIG_FDCHECK
|
||||
@ -737,10 +736,7 @@ int nx_close_from_tcb(FAR struct tcb_s *tcb, int fd)
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
memcpy(&file, filep, sizeof(struct file));
|
||||
memset(filep, 0, sizeof(struct file));
|
||||
|
||||
return file_close(&file);
|
||||
return file_close(filep);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user