Skip to content
Snippets Groups Projects
Commit 4d24e3c4 authored by patacongo's avatar patacongo
Browse files

cosmetic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1253 42af7a65-404d-4744-a932-0658087f49c3
parent e4fa1da5
No related branches found
No related tags found
No related merge requests found
......@@ -150,6 +150,8 @@ static int loop_open(FAR struct inode *inode)
DEBUGASSERT(inode && inode->i_private);
dev = (FAR struct loop_struct_s *)inode->i_private;
/* Make sure we have exclusive access to the state structure */
loop_semtake(dev);
if (dev->opencnt == MAX_OPENCNT)
{
......@@ -157,6 +159,8 @@ static int loop_open(FAR struct inode *inode)
}
else
{
/* Increment the open count */
dev->opencnt++;
}
loop_semgive(dev);
......@@ -178,6 +182,8 @@ static int loop_close(FAR struct inode *inode)
DEBUGASSERT(inode && inode->i_private);
dev = (FAR struct loop_struct_s *)inode->i_private;
/* Make sure we have exclusive access to the state structure */
loop_semtake(dev);
if (dev->opencnt == 0)
{
......@@ -185,6 +191,8 @@ static int loop_close(FAR struct inode *inode)
}
else
{
/* Decrement the open count */
dev->opencnt--;
}
loop_semgive(dev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment