mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
fs/vfs/fs_lock.c: support flock for SHM driver
We can apply file lock on SHM inode as well. Ensure file_lock_get_path function passes and doesn't return EBADF errno. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
parent
726dd10bcd
commit
e1a9b953e2
1 changed files with 5 additions and 2 deletions
|
|
@ -102,10 +102,13 @@ static int file_lock_get_path(FAR struct file *filep, FAR char *path)
|
|||
FAR struct tcb_s *tcb = this_task();
|
||||
bool is_allowed_type;
|
||||
|
||||
/* We only apply file lock on mountpt and driver (f_inode won't be NULL). */
|
||||
/* We only apply file lock on mountpt, driver or shm
|
||||
* (f_inode won't be NULL).
|
||||
*/
|
||||
|
||||
is_allowed_type = INODE_IS_MOUNTPT(filep->f_inode) ||
|
||||
INODE_IS_DRIVER(filep->f_inode);
|
||||
INODE_IS_DRIVER(filep->f_inode) ||
|
||||
INODE_IS_SHM(filep->f_inode);
|
||||
|
||||
if (!is_allowed_type || tcb->flags & TCB_FLAG_SIGNAL_ACTION)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue