summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-07-19 06:52:35 +0800
committerbernard <[email protected]>2014-07-19 06:52:35 +0800
commit0eb35940a400ca2c36a585d30696eac47c6d687a (patch)
tree8107dbd0e4ee5798ca2f8f7ea8127740d5979e03 /components
parent3610e38050958153f94a27501866e49206130295 (diff)
[POSIX] fix mq_open and sem_open argument issue.
Diffstat (limited to 'components')
-rw-r--r--components/pthreads/mqueue.c3
-rw-r--r--components/pthreads/semaphore.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/components/pthreads/mqueue.c b/components/pthreads/mqueue.c
index c1303ae6b1..7b669dc367 100644
--- a/components/pthreads/mqueue.c
+++ b/components/pthreads/mqueue.c
@@ -119,6 +119,7 @@ mqd_t mq_open(const char *name, int oflag, ...)
{
mqd_t mqdes;
va_list arg;
+ mode_t mode;
struct mq_attr *attr = RT_NULL;
/* lock posix mqueue list */
@@ -128,6 +129,8 @@ mqd_t mq_open(const char *name, int oflag, ...)
if (oflag & O_CREAT)
{
va_start(arg, oflag);
+ mode = (mode_t)va_arg(arg, unsigned int);
+ mode = mode;
attr = (struct mq_attr *)va_arg(arg, struct mq_attr *);
va_end(arg);
diff --git a/components/pthreads/semaphore.c b/components/pthreads/semaphore.c
index 726246c95f..ae69e0d1bc 100644
--- a/components/pthreads/semaphore.c
+++ b/components/pthreads/semaphore.c
@@ -224,6 +224,7 @@ sem_t *sem_open(const char *name, int oflag, ...)
{
sem_t* sem;
va_list arg;
+ mode_t mode;
unsigned int value;
sem = RT_NULL;
@@ -233,6 +234,7 @@ sem_t *sem_open(const char *name, int oflag, ...)
if (oflag & O_CREAT)
{
va_start(arg, oflag);
+ mode = (mode_t) va_arg( arg, unsigned int); mode = mode;
value = va_arg( arg, unsigned int);
va_end(arg);