mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:43:28 +08:00
Add macros support that will eventually allow dynamic allocation of strings need to support soft links.
This commit is contained in:
+6
-2
@@ -133,8 +133,7 @@ mqd_t mq_open(FAR const char *mq_name, int oflags, ...)
|
||||
* have incremented the reference count on the inode.
|
||||
*/
|
||||
|
||||
RESET_SEARCH(&desc);
|
||||
desc.path = fullpath;
|
||||
SETUP_SEARCH(&desc, fullpath, false);
|
||||
|
||||
ret = inode_find(&desc);
|
||||
if (ret >= 0)
|
||||
@@ -236,16 +235,21 @@ mqd_t mq_open(FAR const char *mq_name, int oflags, ...)
|
||||
inode->i_crefs = 1;
|
||||
}
|
||||
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
return mqdes;
|
||||
|
||||
errout_with_msgq:
|
||||
mq_msgqfree(msgq);
|
||||
inode->u.i_mqueue = NULL;
|
||||
|
||||
errout_with_inode:
|
||||
inode_release(inode);
|
||||
|
||||
errout_with_lock:
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
|
||||
errout:
|
||||
set_errno(errcode);
|
||||
return (mqd_t)ERROR;
|
||||
|
||||
@@ -87,8 +87,7 @@ int mq_unlink(FAR const char *mq_name)
|
||||
|
||||
/* Get the inode for this message queue. */
|
||||
|
||||
RESET_SEARCH(&desc);
|
||||
desc.path = fullpath;
|
||||
SETUP_SEARCH(&desc, fullpath, false);
|
||||
|
||||
sched_lock();
|
||||
ret = inode_find(&desc);
|
||||
@@ -97,7 +96,7 @@ int mq_unlink(FAR const char *mq_name)
|
||||
/* There is no inode that includes in this path */
|
||||
|
||||
errcode = -ret;
|
||||
goto errout;
|
||||
goto errout_with_search;
|
||||
}
|
||||
|
||||
/* Get the search results */
|
||||
@@ -149,14 +148,18 @@ int mq_unlink(FAR const char *mq_name)
|
||||
|
||||
inode_semgive();
|
||||
mq_inode_release(inode);
|
||||
RELEASE_SEARCH(&desc);
|
||||
sched_unlock();
|
||||
return OK;
|
||||
|
||||
errout_with_semaphore:
|
||||
inode_semgive();
|
||||
|
||||
errout_with_inode:
|
||||
inode_release(inode);
|
||||
errout:
|
||||
|
||||
errout_with_search:
|
||||
RELEASE_SEARCH(&desc);
|
||||
set_errno(errcode);
|
||||
sched_unlock();
|
||||
return ERROR;
|
||||
|
||||
Reference in New Issue
Block a user