From 6cc5722a61e2cf5b6c12e7d93f408723a05e1119 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 19 Feb 2019 14:14:35 -0600 Subject: [PATCH] lib: posix: Fix compile error with mqueue.h With newer newlib we get a build error with mqueue.h realted to mode_t. Let's just let newlib define mode_t and have minimal libc also define it in sys/types.h. So we remove the duplicated definition in posix/unistd.h. Signed-off-by: Kumar Gala --- include/posix/mqueue.h | 1 - include/posix/unistd.h | 5 ----- lib/libc/minimal/include/sys/types.h | 2 ++ 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/posix/mqueue.h b/include/posix/mqueue.h index 53210b5f95..3bb9a0e664 100644 --- a/include/posix/mqueue.h +++ b/include/posix/mqueue.h @@ -17,7 +17,6 @@ extern "C" { #endif typedef void *mqd_t; -typedef unsigned int mode_t; typedef struct mq_attr { long mq_flags; diff --git a/include/posix/unistd.h b/include/posix/unistd.h index e68b46c212..7dc39e9f6f 100644 --- a/include/posix/unistd.h +++ b/include/posix/unistd.h @@ -16,11 +16,6 @@ extern "C" { #ifdef CONFIG_POSIX_API #include -#ifndef _MODE_T_DECLARED -typedef unsigned int mode_t; -#define _MODE_T_DECLARED -#endif - /* File related operations */ extern int open(const char *name, int flags); extern int close(int file); diff --git a/lib/libc/minimal/include/sys/types.h b/lib/libc/minimal/include/sys/types.h index 55a62116e2..007c077d8d 100644 --- a/lib/libc/minimal/include/sys/types.h +++ b/lib/libc/minimal/include/sys/types.h @@ -8,6 +8,8 @@ #ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_TYPES_H_ #define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_SYS_TYPES_H_ +typedef unsigned int mode_t; + #if !defined(__ssize_t_defined) #define __ssize_t_defined