[POSIX] fix mq_open and sem_open argument issue.
This commit is contained in:
parent
3610e38050
commit
0eb35940a4
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue