mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
fs: remove un-useful memcpy() in nx_close_from_tcb()
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
+1
-5
@@ -712,7 +712,6 @@ int dup3(int fd1, int fd2, int flags)
|
|||||||
int nx_close_from_tcb(FAR struct tcb_s *tcb, int fd)
|
int nx_close_from_tcb(FAR struct tcb_s *tcb, int fd)
|
||||||
{
|
{
|
||||||
FAR struct file *filep;
|
FAR struct file *filep;
|
||||||
FAR struct file file;
|
|
||||||
FAR struct filelist *list;
|
FAR struct filelist *list;
|
||||||
|
|
||||||
#ifdef CONFIG_FDCHECK
|
#ifdef CONFIG_FDCHECK
|
||||||
@@ -737,10 +736,7 @@ int nx_close_from_tcb(FAR struct tcb_s *tcb, int fd)
|
|||||||
return -EBADF;
|
return -EBADF;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&file, filep, sizeof(struct file));
|
return file_close(filep);
|
||||||
memset(filep, 0, sizeof(struct file));
|
|
||||||
|
|
||||||
return file_close(&file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user