[POSIX] fix mq_open and sem_open argument issue.

This commit is contained in:
bernard 2014-07-19 06:52:35 +08:00
parent 3610e38050
commit 0eb35940a4
2 changed files with 5 additions and 0 deletions

View File

@ -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);

View File

@ -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);