mirror of
https://github.com/apache/nuttx.git
synced 2026-08-17 09:33:18 +08: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:
+5
-2
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user