fs/vfs: fix dup issue for eventfd/signalfd/timerfd

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2023-09-08 16:02:49 +08:00 committed by Xiang Xiao
parent 30bb3086be
commit 6367f2469c
3 changed files with 4 additions and 0 deletions

View File

@ -135,6 +135,7 @@ static FAR struct eventfd_priv_s *eventfd_allocdev(void)
nxmutex_init(&dev->lock);
nxmutex_lock(&dev->lock);
dev->crefs++;
}
return dev;

View File

@ -355,6 +355,8 @@ int signalfd(int fd, FAR const sigset_t *mask, int flags)
ret = -fd;
goto errout_with_dev;
}
dev->crefs++;
}
else
{

View File

@ -146,6 +146,7 @@ static FAR struct timerfd_priv_s *timerfd_allocdev(void)
nxmutex_init(&dev->lock);
nxmutex_lock(&dev->lock);
dev->crefs++;
}
return dev;