diff --git a/components/pthreads/mqueue.c b/components/pthreads/mqueue.c index c1303ae6b17afb841d02f67eb07121da3d142919..7b669dc3678093958fcb2b19fb4b35d478bdc6cb 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 726246c95f077c18bf20e76948371f11a125fe03..ae69e0d1bc7547c7a9019710c2907e610fd71632 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);