sched/dupfile: ignore dup failed when task_create

MIRTOS-517

Change-Id: I2387ab447f0d8ed9429960922a72de35b2730acb
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong
2021-03-22 15:08:39 +08:00
committed by liguiding1
parent 152db4f0bf
commit 293c7e6b6f
+10 -3
View File
@@ -103,14 +103,17 @@ int file_dup2(FAR struct file *filep1, FAR struct file *filep2)
* can maintain the correct open counts.
*/
if (inode->u.i_ops && inode->u.i_ops->open)
if (inode->u.i_ops)
{
#ifndef CONFIG_DISABLE_MOUNTPOINT
if (INODE_IS_MOUNTPT(inode))
{
/* Dup the open file on the in the new file structure */
ret = inode->u.i_mops->dup(filep1, &temp);
if (inode->u.i_mops->dup)
{
ret = inode->u.i_mops->dup(filep1, &temp);
}
}
else
#endif
@@ -118,7 +121,11 @@ int file_dup2(FAR struct file *filep1, FAR struct file *filep2)
/* (Re-)open the pseudo file or device driver */
temp.f_priv = filep1->f_priv;
ret = inode->u.i_ops->open(&temp);
if (inode->u.i_ops->open)
{
ret = inode->u.i_ops->open(&temp);
}
}
/* Handle open failures */