fs/vfs: fix dup issue for eventfd/signalfd/timerfd
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
30bb3086be
commit
6367f2469c
@ -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;
|
||||
|
@ -355,6 +355,8 @@ int signalfd(int fd, FAR const sigset_t *mask, int flags)
|
||||
ret = -fd;
|
||||
goto errout_with_dev;
|
||||
}
|
||||
|
||||
dev->crefs++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user